Skip to content

In memory cache for Node. You can use multi cache space like namespace.

Notifications You must be signed in to change notification settings

sekitaka/node-cache-store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-cache-store

A in-memory cache system.

  • Key/Value store.
  • You can use multi cache space like namespace.

Installation

npm install node-cache-store

Usage

Simple usage

var Cache = require('node-cache-store').Cache;
var cache = new Cache() ;

// Set a cache
cache.set('key', 'value');

// get a cache
cache.set('key');

// delete a cache
cache.delete('key') ;

Multi namespace usage

var CacheStore = require('node-cache-store').CacheStore;
var cache1 = CacheStore.getInstance('space1') ;
cache1.set('foo','foo') ;

Options

var opt = {
    expire: 3600 ; // Cache expire time(sec). Defalt is no limit(-1).
    expiredLoopTerm: 3600   // interval for delete expired data(sec). Defalt is 3600 ;
} ;
var cache = new Cache(opt) ;
var cache1 = CacheStore.getInstance('space1',opt) ;

Support

Open an issue on GitHub.

About

In memory cache for Node. You can use multi cache space like namespace.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published