Memcached promisified wrapper library
npm install memcached-promisifyMemcached promisified wrapper library
``shell`
npm install memcached-promisify --save
shell
const Cache = require('memcached-promisify');const cache = new Cache();
cache.set('foo', 'bar', 20)
.then((result) => {
// successful set...
}, (err) => {
// something happened...
});
`options
The following can be passed when instantiating:
* an object with a cache key prefix and the cache host URL, both optional
* memcached options (see https://www.npmjs.com/package/memcached#options)
`shell
const Cache = require('memcached-promisify');// uses cache host at localhost:11211 by default
const cache1 = new Cache({ 'keyPrefix': 'prefix' });
// specific cache host
const cache2 = new Cache({ 'keyPrefix': 'prefix', 'cacheHost': 'other.host.com' });
`tests
Run the tests
`shell
grunt test
``