Simple cache for JSON data with a REST API
npm install cache
|1|| downloads in the last day|
|7|| downloads in the last week|
|28|| downloads in the last month|
Cache - A simple cache for JSON data with a REST API
Stores the given value under the key "foo".
"key" is required.
"val" is required, and must be valid JSON text:
If val is "null", or the JSON can't be parsed, the value will be deleted.
"ttl" and "save" are optional:
The value will flushed from cache after "secs" seconds.
Attempts to "get" the value will return null.
If ttl is 0 or is omitted, then the value doesn't expire.
If "true", cache is saved to disk after value is set or deleted.
Return the object stored under the key "foo".
Force cache to immediately be saved to disk.