2.1.0 • Published 5 years ago

the-cache v2.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

the-cache

Build Status npm Version JS Standard

Cache manager of the-frameworks

Installation

$ npm install the-cache --save

Usage

'use strict'

const theCache = require('the-cache')

async function tryExample () {
  const cache = theCache({
    max: 10000,
    maxAge: 1000 * 60 * 60
  })

  cache.set('foo', 'bar')
  const foo = cache.get('foo')
  console.log(foo) // -> 'bar'
  cache.reset() // remove all
}

tryExample().catch((err) => console.error(err))

API Guide

License

This software is released under the MIT License.

Links