memchync
v1.1.0
Published
An async/await wrapper package for memcached.
Downloads
13
Readme
memchync
An async/await wrapper package for memcached.
installation
npm i memchync --save
api
const memchync= require('./memchync')
// initialize memcached
/**
* @param Server locations
* @param options
*/
memchync.init('127.0.0.1:11211', {
maxValue: 65536
})
// memcached instance
memchync.memcached
Public methods
Supports all memcached public methods. If an error has occurred, it will return the error object otherwise it will return the data or (int)1 if no data that needs to be returned.
;(async function() {
// returns 0 if success else error object
const foo = await memchync.add('foo', 'bar', 60)
// returns 'bar' else error object
const bar = await memchync.get('foo')
})()
License
MIT