expiry-set
A
Set
implementation with expirable keys
Install
$ npm install expiry-set
Usage
; const set = 1000 'unicorn'; set;//=> true set; console;//=> 2 // Wait for 1 second...set;//=> false console;//=> 0
API
ExpirySet(maxAge, [iterable])
maxAge
Type: number
Milliseconds until a key in the Set
expires.
iterable
Type: Object
An Array
or other iterable
object.
Instance
Any of the Set methods.
Related
- expiry-map - A
Map
implementation with expirable items
License
MIT © Sam Verschueren