Class: JSONCache

JSONCache


new JSONCache(url [, timeout], options)

Make a new cache
Parameters:
Name Type Argument Default Description
url string url to fetch
timeout number <optional>
60000 optional timeout
options Object Options object
Properties
Name Type Description
parser function optional parser to parse data. defaults to JSON.parse
promiseLib Class optional promise library override
logger Object optional Logger
delayStart boolean whether or not to delay starting updating the cache until start is requested
opts Object options to pass to the parser
maxListeners number maximum listeners (only applicable if leveraging emitter)
useEmitter boolean whether or not to use the optional node emitter
maxRetry number maximum number of attempts to retry getting data
integrity function optional function to check if the data is worth keeping
Source: