@hoolymama/pomtime
v0.0.3
Published
pomodoro style timer utils
Downloads
2
Readme
Pomodoro Timer
Pomodoro timer with work and relax phases
Installation
npm install @hoolymama/pomtime
Usage
var PomodoroTimer = require('@hoolymama/pomtime');
or import PomodoroTimer from '@hoolymama/pomtime'
Create an options object containing the number of work seconds, rest seconds, and callbacks.
opts = {}
opts.workSeconds = 20
opts.restSeconds = 8
opts.onSecondsChange = function(obj){console.log("onSecondsChange"); console.log(obj)}
opts.onWorkEnd = function(obj){console.log("onWorkEnd"); console.log(obj)}
opts.onRestEnd = function(obj){console.log("onRestEnd"); console.log(obj)}
opts.onStopTimer = function(obj){console.log("onStopTimer"); console.log(obj)}
Create a new PomTimer with above options and start it.
var myTimer = new PomodoroTimer(opts)
myTimer.start()
myTimer.stop()
Tests
npm test