1.3.3 • Published 12 years ago

lru-list v1.3.3

Weekly downloads
4
License
-
Repository
github
Last release
12 years ago

lru-list

Storage-agnostic LRU list with async/multi-key operations.

Build Status

Example

var list = require('lru-list').create()

list.setOption('limit', 50)
    .setOption('set', function(pairs, cb) {
      // Write to storage ...
      cb(/* or Error() */);
    })
    .setOption('get', function(keys, cb) {
      // Read from storage ...
      cb(/* or Error() */, pairs);
    })
    .setOption('del', function(keys, cb) {
      // Write to storage ...
      cb(/* or Error() */);
    });

list.set(key, val, function setDone(err) { /* ... */ });
list.set(pairs, function setDone(err) { /* ... */ });
list.shift(function shiftDone(err) { /* ... */ });
list.get(keys, function getDone(err, val) { /* ... */ });
list.del(keys, function delDone(err) { /* ... */ });

Installation

NPM

npm install lru-list

component

component install codeactual/lru-list

API Documentation

LRUList / LRUEntry

License

MIT

Based on https://github.com/rsms/js-lru (MIT).

Tests

Node

npm test

Browser via Karma

  • npm install karma
  • karma start
  • Browse http://localhost:9876/
  • make build && karma run
1.3.3

12 years ago

1.3.2

12 years ago

1.3.1

12 years ago

1.3.0

12 years ago