1.2.0 • Published 7 years ago
js-data-cache v1.2.0
Data Cache
Simple data caching for Javascript
Installation
$ npm install js-data-cache --save
Usage
// include default response
var cache = require('js-data-cache');
var customer;
var data = [
{
id: 'test-uuid-1',
name: 'John Smith'
},
{
id: 'test-uuid-2',
name: 'George Miller'
}
];
cache.set(data, [ 'id' ]);
customer = cache.get('id', 'test-uuid-1');
console.log(customer);