flat-cache
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "flat-cache", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "A stupidly simple key/value storage using files to persist the data", | ||
@@ -5,0 +5,0 @@ "repository": "royriojas/flat-cache", |
@@ -16,5 +16,6 @@ # flat-cache | ||
```js | ||
var flatCache = require('flat-cache') | ||
// loads the cache, if one does not exists for the given | ||
// Id a new one will be prepared to be created | ||
var cache = require('flat-cache').load('cacheId'); | ||
var cache = flatCache.load('cacheId'); | ||
@@ -35,3 +36,10 @@ // sets a key on the cache | ||
// not exists for the given Id a new one will be prepared to be created | ||
var cache = require('flat-cache').load('cacheId', path.resolve('./path/to/folder')); | ||
var cache = flatCache.load('cacheId', path.resolve('./path/to/folder')); | ||
// The following methods are useful to clear the cache | ||
// delete a given cache | ||
flatCache.clearCacheById('cacheId') // removes the cacheId document if one exists. | ||
// delete all cache | ||
flatCache.clearAll(); // remove the cache directory | ||
``` | ||
@@ -38,0 +46,0 @@ |
8460
66