1.0.2 • Published 6 years ago

periodically v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
6 years ago

periodically

Because sometimes you need to do something periodically

Installtion

npm install --save periodically

or

yarn add periodically

Use

const periodically = require('../periodically')


function someFuncThatEvenUsesAPromise() {
  return new Promise(resolve => {
    resolve(true)
  })
}

// Run it every second
const checker = periodically(someFuncThatEvenUsesAPromise, 1000);

// Start it going
checker.start()

// Stop it if you need to
checker.stop()