npm install --save cache-manager-web
import CreateCache from 'cache-manager-web'
const Cache = CreateCache({
store: 'memory',
max: 100,
ttl: 5 * 1000
})
const getMockDate = () => new Promise((resolve, reject) => {
setTimeout(() => {
resolve({ success: true })
}, 500)
})
const init = async () => {
const key = 'test'
const data = await Cache.wrap(key, getMockDate)
}
init()
- Improve README.md documentation
- 100% test coverage via mocha, nyc
cache-manager-web is licensed under the MIT license.