node-routine-runner

A utility package for running promised code a given # of times at a set interval.

Usage no npm install needed!

<script type="module">
  import nodeRoutineRunner from 'https://cdn.skypack.dev/node-routine-runner';
</script>

README

node-routine-runner

A utility package for running promised code a given # of times at a set interval.

Prerequisities

No prerequisities

Installing

Install using npm

npm install node-routine-runner

Using

Importing in ES6

import { BaseRoutine, RoutineRunner } from 'node-routine-runner';

Extend BaseRoutine overriding the execute with your own promise

class TestRoutine extends BaseRoutine {
    execute() {
        return restClient.send();
    }
}

Initialize new RoutineRunner and execute

new RoutineRunner(TestRoutine, 5, 2000).start().then(() => {
    console.log('Complete');
})

Built With

  • Javascript ES6
  • Node
  • Babel
  • Mocha, Sinon, Chai

Authors

  • Steven Haddix

License

This project is licensed under the ISC License