fn-runner

1.1.3 • Public • Published

fn-runner

Build Status

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

Package Sidebar

Install

npm i fn-runner

Weekly Downloads

2

Version

1.1.3

License

MIT

Last publish

Collaborators

  • hobodermo