timmerman
An accurate countdown timer that works with event emitters.
Usage
Installation
$ npm install timmerman
Usage
Import timmerman
into your project.
;
Use it by creating an instance and passing a timer duration in milliseconds. It will tick every 10ms by default.
From there, you can have the timer start, skip, stop or wait.
const timer = 3000 100; // Tick every 100ms until 3000mstimerstart; // Start counting downtimer; // Pause countingtimer; // Skip 500mstimer; // Resume counting downtimer; // Stop counting down and reset to the duration.
Timmerman is an event emitter itself and you can use the on
and off
functions to listen for the timer's states.
const timer = 3000;timerstart; timer;timer;timer;timer;timer;timer;timer;
Contributing
Want to contribute? Great! Please branch out from the master version from using a branchname such as feature/{insert-descriptive-feature-name}
and create a pull request when ready.
Use npm run build
to build the project.