@bongione/recurrent-task

0.0.1 • Public • Published

recurrent-task

Start named task that repeat at the same interval, with some logging of how they're performing

Install

npm install @bongione/recurrent-task

Usage

To use the library


let {startRecurrentTask, stopRecurrentTask} = require('@bongione/recurrent-task')

function myRecurrentTask() {
    // Do something useful
}   

// Run the task every 10 minutes
startRecurrentTask('NAME_OF_TASK', myRecurrentTask, 10 * 60 * 1000)

process.on('SIGINT', () => {
    recurrent_tasks.stopRecurrentTask('NAME_OF_TASK')
})


License

Apache 2.0

/@bongione/recurrent-task/

    Package Sidebar

    Install

    npm i @bongione/recurrent-task

    Weekly Downloads

    3

    Version

    0.0.1

    License

    Apache-2.0

    Last publish

    Collaborators

    • bongione