Name: diskstore
Owner: node_modules
Description: a local cache implement
Created: 2017-10-11 09:04:22.0
Updated: 2017-12-05 03:19:19.0
Pushed: 2018-03-08 11:00:25.0
Homepage: null
Size: 8
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
a basic local cache implementation
A basic file cache implementation. It just providers low-level APIs (get, set, delete) to allow you read & atomic write from file cache. You can also create your implementation by inheriting or wrapping it.
m install diskstore --save
new DiskStore(options)
* get(relativePath)
read data from relativePath if the file exists.* set(relativePath, data)
write data to relativePath* delete(relativePath)
delete the filet diskStore = new DiskStore({
cheDir: '/path/cache',
d diskStore.set('a/b/c', 'c');
data = yield diskStore.get('a/b/c');
rt.deepEqual(data, new Buffer('c'));
d diskStore.delete('a/b/c');
= yield diskStore.get('a/b/c');
rt(data === null);