object-store
In Memory Object Store which supports redis, memcached, and lru-cache
Last updated 7 years ago by suwanny .
BSD · Repository · Original npm · Tarball · package.json
$ cnpm install object-store 
SYNC missed versions from official npm registry.

object-store

In Memory Object Store which supports redis, memcached, and lru-cache

Install

npm install object-store

Create a store

===================

Callback based

var ObjectStore = require('object-store')
var store = ObjectStore.create('redis'); // redis
var store = ObjectStore.create('memcached'); // memcached
var store = ObjectStore.create('memory'); // memory

Deferred (based on Promise)

var DeferredStore = require('object-store').DeferredStore;
var store = new DeferredStore('redis');
var store = new DeferredStore('memcached');
var store = new DeferredStore('memory');

Store Methods

===================

Get

store.get("hello", function(err, resp) { ... })

Set

store.set("hello", {hello: 'world'}, function(err, resp) { ... });

Keys

store.keys("*", function(err, resp) { ... });

Delete

store.del("hello", function(err, resp) { ... });

Has

store.has("hello", function(err, resp) { ... });

Delete all

store.flush(function(err, resp) { ... });

Run Demos

node demo/memcached_async.js
node demo/memcached_q.js
node demo/redis_async.js
node demo/redis_q.js
node demo/memory_async.js
node demo/memory_q.js

License

MIT

Current Tags

  • 0.0.1                                ...           latest (7 years ago)

1 Versions

  • 0.0.1                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (12)
Dev Dependencies (0)
None
Dependents (2)

Copyright 2014 - 2016 © taobao.org |