free-cache
v1.0.1
Published
Simple cache tool with required functions | easy to use.
Downloads
10
Maintainers
Readme
free-cache
Simple cache tool with required functions | easy to use.
Installation
npm install free-cache --save
Usage
var freeCache = require('free-cache');
// now ready to to use the cache
freeCache.put('email', 'my-email-id', true);
console.log(freeCache.get('email'));
// set timeout for specific key-value
freeCache.put('token', 'token-to-expire', true, 1000); // Time in ms
// set overwrite to false for a key for data integrity
freeCache.put('id', 'dont-overwrite-me', false);
//other functions
freeCache.delete('id');
console.log(freeCache.memsize('id'));
console.log(freeCache.getAllKeys('id'));