expiring_map

1.0.1 • Public • Published

Build Status

Install

npm install --save expiring_map

Use

Provide an expiration time, in milliseconds, to the constructor. Expiration times can also be provided for each set call. If there's no expiration time, the entry will never expire.

const ExpiringMap = require('expiring_map').ExpiringMap

let map = new ExpiringMap(3000)
map.set(1, 1)  // will expire after 3 seconds
map.set(2, 2, 1000)  // will expire after 1 second

let map2 = new ExpiringMap()
map2.set(1, 1)  // will never expire

Package Sidebar

Install

npm i expiring_map

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

2.12 kB

Total Files

3

Last publish

Collaborators

  • tyler-murphy