UNPKG

ice.fo.utils

Version:

30 lines (22 loc) 461 B
import NodeCache from 'node-cache' const store = new NodeCache({ stdTTL: 60, }) export function put ({ key, value, seconds }) { store.set(key, value, seconds) } export function get ({ key }) { return store.get(key) } export function remove ({ key }) { return store.del(key) } export function removeAll () { return store.flushAll() } export function has ({ key }) { return store.has(key) } export function getKeys () { return store.keys() }