1.0.2 • Published 5 years ago

su-simple-cache v1.0.2

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

init(dpath) ⇒ simpleCache

initialise the simpleCache instance

Kind: global function
Returns: simpleCache - this instance

ParamTypeDescription
dpathstringpath to the cache directory

set(key, value) ⇒ Promise

sets a key-value pair in a file in the cache directory

Kind: global function
Returns: Promise - resolves into object containing cached file info

ParamTypeDescription
keystringUnique identifier
valuedynamicJSON serializable data

get(key) ⇒ Promise

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

ParamTypeDescription
keystringUnique identifier

isCached(key) ⇒ Promise

asynchronously checks if the file with the given key is cached in the cache directory

Kind: global function
Returns: Promise - boolean

ParamTypeDescription
keystringUnique identifier

isCachedSync(key) ⇒ boolean

synchronous version of isCached

Kind: global function

ParamTypeDescription
keystringUnique identifier

delete(key) ⇒ Promise

deletes the file associated with the given key

Kind: global function
Returns: Promise - resolves to true if successful

ParamTypeDescription
keystringUnique identifier

deleteSync(key) ⇒ void

synchronous version of delete

Kind: global function

ParamTypeDescription
keystringUnique identifier

deleteAll() ⇒ Promise

asynchronously deletes cache directory

Kind: global function
Returns: Promise - resolves to true if successful

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago