events-window
v1.0.0
Published
A data structure to store and retrieve events, it could only store events that are happened for a short while.
Downloads
1
Readme
events-window
A data structure to store and retrieve events, it only store events that are happened for a short while.
Quick start
import EventsWindow from 'events-window';
const ew = new EventsWindow();
ew.add('good message', Date.now());
ew.add('bad message', Date.now());
for (const [v, t] of ew.events(Date.now() - 2000)) {
console.log(`receive event ${v} at ${t}`);
}
Installation
npm i events-window;
Development
# test
npm run test:watch
# build
npm run build