var flatCache = require('flat-cache');
var cachePath = './__cache/';
// Written three key
var cache = flatCache.load('cacheId', cachePath);
cache.setKey('key', {
foo: 'var'
});
cache.setKey('key2', {
foo: 'var2'
});
cache.setKey('key3', {
foo: 'var3'
});
cache.save();
// => {"key":{"foo":"var"},"key2":{"foo":"var2"},"key3":{"foo":"var3"}}
// I want to use only one key, but I 'll cover the other key when you save
var cache2 = flatCache.load('cacheId', cachePath);
cache2.setKey('key', {
foo: 'var'
});
cache2.save();
// => {"key":{"foo":"var"}}
Under normal circumstances , I would like to use a key, but do not want to cover the rest, I do not know whether there is such a demand problem , thank you~
Under normal circumstances , I would like to use a key, but do not want to cover the rest, I do not know whether there is such a demand problem , thank you~