cache-point
Example
const Cache = require('cache-point')
const cache = new Cache({ cacheDir: '~/.cache' })
Cache ⏏
Kind: Exported class
new Cache([options])
Param | Type |
---|
[options] | object |
[options.cacheDir] | string |
cache.cacheDir : string
Cache directory
Kind: instance property of Cache
cache.read(keys) ⇒ Promise
Cache hit resolves, miss rejects.
Kind: instance method of Cache
Param | Type | Description |
---|
keys | * | One or more values to index the data, e.g. a request object or set of function args. |
cache.write(keys, content) ⇒ Promise
Write some data to the cache with a key.
Kind: instance method of Cache
Param | Type | Description |
---|
keys | * | One or more values to index the data, e.g. a request object or set of function args. |
content | * | the data to store |
cache.getChecksum(keys) ⇒ string
Converts a key value into a hex checksum.
Kind: instance method of Cache
Param | Type | Description |
---|
keys | * | One or more values to index the data, e.g. a request object or set of function args. |
cache.clean() ⇒ Promise
Cleans the cache.
Kind: instance method of Cache
cache.remove() ⇒ Promise
Cleans and removes the cache.
Kind: instance method of Cache
© 2016 Lloyd Brookes <75pound@gmail.com>. Documented by jsdoc-to-markdown.