/ piacw.com / dev / final / node_modules / lru-cache /

[ICO]NameLast modifiedSizeDescription
[PARENTDIR]Parent Directory  -  
[   ]LICENSE2 years ago765 0fb859dc fixed mobile overflwo options [كارل مبارك]
[TXT]README.md2 years ago5.8K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]index.js2 years ago8.0K0fb859dc fixed mobile overflwo options [كارل مبارك]
[   ]package.json2 years ago1.9K0fb859dc fixed mobile overflwo options [كارل مبارك]
README.md

lru cache

A cache object that deletes the least-recently-used items.

Build Status Coverage Status

Installation:

npm install lru-cache --save

Usage:

var LRU = require("lru-cache")
  , options = { max: 500
              , length: function (n, key) { return n * 2 + key.length }
              , dispose: function (key, n) { n.close() }
              , maxAge: 1000 * 60 * 60 }
  , cache = new LRU(options)
  , otherCache = new LRU(50) // sets just the max size

cache.set("key", "value")
cache.get("key") // "value"

// non-string keys ARE fully supported
// but note that it must be THE SAME object, not
// just a JSON-equivalent object.
var someObject = { a: 1 }
cache.set(someObject, 'a value')
// Object keys are not toString()-ed
cache.set('[object Object]', 'a different value')
assert.equal(cache.get(someObject), 'a value')
// A similar object with same keys/values won't work,
// because it's a different object identity
assert.equal(cache.get({ a: 1 }), undefined)

cache.reset()    // empty the cache

If you put more stuff in it, then items will fall out.

If you try to put an oversized thing in it, then it'll fall out right away.

Options

API

Apache/2.4.38 (Debian) Server at www.karls.computer Port 80