event-test-clock-pmb

1.0.0 • Public • Published

event-test-clock-pmb

EventEmitter + Timer + Counter. Easily generate time events for testing.

Usage

// var makeClock = require('event-test-clock-pmb');
cfg = Object.assign({ intvName: 'qtrSec', intvSec: 0.25 }, cfg);
var clk = makeClock(cfg);
clk.on('qtrSec', function (t) {
  if (clk.verbose) { console.log(String(clk), 'tick', t, clk.intvName); }
  clk.emitNthTicks('halfSec', 2);
  clk.emitNthTicks('fullSec', 4);
  clk.emitNthTicks('dblSec',  8);
});
// for more demo, see package "event-historian-pmb"

Known issues

  • needs more/better tests and docs

 

License

ISC

Readme

Keywords

Package Sidebar

Install

npm i event-test-clock-pmb

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • mk-pmb