- init(dpath) ⇒
simpleCache
- set(key, value) ⇒
Promise
- get(key) ⇒
Promise
- isCached(key) ⇒
Promise
- isCachedSync(key) ⇒
boolean
- delete(key) ⇒
Promise
- deleteSync(key) ⇒
void
- deleteAll() ⇒
Promise
initialise the simpleCache instance
Kind: global function
Returns: simpleCache
- this instance
Param | Type | Description |
---|---|---|
dpath | string |
path to the cache directory |
sets a key-value pair in a file in the cache directory
Kind: global function
Returns: Promise
- resolves into object containing cached file info
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
value | dynamic |
JSON serializable data |
gets the value given a key by looking up for the corresponding file in the cache directory
Kind: global function
Returns: Promise
- resolves into object containing cached file info
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
asynchronously checks if the file with the given key is cached in the cache directory
Kind: global function
Returns: Promise
- boolean
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
synchronous version of isCached
Kind: global function
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
deletes the file associated with the given key
Kind: global function
Returns: Promise
- resolves to true if successful
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
synchronous version of delete
Kind: global function
Param | Type | Description |
---|---|---|
key | string |
Unique identifier |
asynchronously deletes cache directory
Kind: global function
Returns: Promise
- resolves to true if successful