1.0.2 • Published 11 years ago

ncache v1.0.2

Weekly downloads
2
License
-
Repository
-
Last release
11 years ago

node-cache

Memcache system for node js

Using node-cache

Install it in your node server using npm install ncache - https://npmjs.org/package/ncache

Usage:

var Cache = require("ncache");
var foo = {
    id: 10,
    name, "FOO"
};
Cache.set(foo.id, foo, 25);         /* foo will be in memcache for 25 seconds, and we will acces it with its id*/

Usage:

var Cache = require("ncache");
var foo = {
    id: 10,
    name, "FOO"
};
Cache.set(foo.id, foo, 25);        
Cache.get(10);                      /* Returns {id:10, name: "foo"} if the countdown hasn't finished, else null */

Usage:

var Cache = require("ncache");
var foo = {
    id = 10;
    name = "FOO"
};
Cache.set(foo.id, foo, 25);

Cache.remove(10);                   /* Returns true if it is still in cache, if it isn't false */

Cache.get(10);                      /* Returns null */