缓存所有东西一个基于Q的Node.js库,用于缓存事物,它们都专门在Redis或Memcached中。

用法:


npm install cacheallthethings --save

示例代码:


var CacheAllTheThings = require('cacheallthethings');

var cache = new CacheAllTheThings('redis', { 

  host: '127.0.0.1',

  port: '6379',

  auth: null,

  opts: { namespace: 'cachebabycache' }

});



var cache = new CacheAllTheThings('memcached', {

  host: '127.0.0.1',

  port: '11211',

  auth: null,

  opts: { namespace: 'cachebabycache' }

});