1.1.2 • Published 6 months ago

@headwall/easy-cronjs v1.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

easy-cronjs

A simple tool for running multiple periodic tasks at regular intervals. There's a global start/stop and jobs can be started/stopped individually too.

Usage

const cron = require('@headwall/easy-cronjs');

// Enable diagnostics (optional).
// cron.enableDiagnostics = true;

// Do something every 1000ms (one second interval)
cron.addJob('My Cron Job', 1000, () => {
	console.log('tick');
});

// Start easy-cronjs
cron.start();

//
// Your application logic...
//

// Stop easy-cronjs
cron.stop();

// All done
console.log('end');

Other useful bits

// Disable an individual job by name.
cron.disableJob('My Cron Job');

// Enable an individual job by name.
cron.enableJob('My Cron Job');

// How many jobs are currently managed?
console.log(cron.getJobCount());
1.1.2

6 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.1.0

1 year ago