1.0.3 • Published 8 years ago

json-timeout v1.0.3

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

json-timeout

Auto destroy unused key (timeout)

npm npm

Install

npm i --save json-timeout

Usage

const json = require('json-timeout');
const obj = json(1000 * 60); // destroy entry every 60s
obj.set('hello', 'world'); 
const hello = obj.get('hello'); // world

Events

obj.listeners.on('get', (key) => {})     // key get
obj.listeners.on('set', (key) => {})     // key set
obj.listeners.on('delete', (key) => {})  // key timeout expired 

Author

Francesco Cannizzaro

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago