UNPKG

@accounter/server

Version:
13 lines (10 loc) 325 B
import NodeCache from 'node-cache'; export function getCacheInstance(options?: NodeCache.Options) { const instance = new NodeCache(options); return { get: instance.get.bind(instance), set: instance.set.bind(instance), delete: instance.del.bind(instance), clear: instance.flushAll.bind(instance), }; }