fn-runner
v1.1.3
Published
A simple task runner to run a function periodically
Downloads
9
Maintainers
Readme
fn-runner
A simple task runner to run a function periodically
Install
$ npm install --save fn-runner
Usage
var fn = function () {
//Logic
};
//Timeout 1000ms
//Callback fn
var runner1 = new fnRunner(1000, fn);
runner1.start(); //Run fn() every 1000ms
runner1.isStopped();
//=> false
runner1.stop(); //Stop running fn()
runner1.isStopped();
//=> true
//Timeout 1000ms
//Callback fn
//Start Immediately true
var runner2 = new fnRunner(1000, fn, true);
runner2.isStopped();
//=> false
runner2.stop(); //Stop running fn()
runner2.isStopped();
//=> true
License
MIT © Diarmuid Delaney