sancho-cache
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

sancho-cache

Npm

https://www.npmjs.com/package/sancho-cache

Install

npm install --save sancho-cache

Use

const { Cache, globalCache } = require('sancho-cache');

// const cache = globalCache; // global variable object
const cache = new Cache({ exp: 50000, interval: 5000 }); // local variable object
// (Option)
// exp: Default expired time(ms)
// interval: Check delete expired cache interval(ms)

cache.set('test', 'hello', 6000); // key: 'test', 'value': 'hello', expired(option): 6000ms
cache.get('test'); // 'hello'

// after 7000ms
cache.get('test'); // undefined

Readme

Keywords

Package Sidebar

Install

npm i sancho-cache

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

10.4 kB

Total Files

7

Last publish

Collaborators

  • sanchoco