0.0.3 • Published 5 years ago

fln-cache v0.0.3

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

Installation

npm install fln-cache

Usage

import fln_cache from 'fln-cache'

let cache1 = fln_cache('mycache1')
let cache2 = fln_cache('mycache2')

cache1.set('id1', 'data cached', 10) // 10 seconds of cache, default is 1 sec
cache1.set('id2', {a:1, b:2})
cache2.set('id1', {x:10})
cache2.set('id2', [1,2,3])

cache1.get('id2') // returns {a:1, b:2}
cache2.get('id2') // returns [1,2,3]

cache1.clear('id1')
cache2.clearAll()