https://github.com/b-coimbra/chronos
cron-like job scheduler
https://github.com/b-coimbra/chronos
cron cronjob-scheduler crontab scheduler typescript
Last synced: about 2 months ago
JSON representation
cron-like job scheduler
- Host: GitHub
- URL: https://github.com/b-coimbra/chronos
- Owner: b-coimbra
- Created: 2020-07-25T21:02:25.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-08-15T17:58:54.000Z (almost 5 years ago)
- Last Synced: 2025-02-02T00:44:19.756Z (4 months ago)
- Topics: cron, cronjob-scheduler, crontab, scheduler, typescript
- Language: TypeScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.org
Awesome Lists containing this project
README
* chronos
Yet another cron-like job scheduler.
* Usage
#+begin_src javascript
scheduler.on('* * * * *', () => {
console.log('this function executes every minute');
}, {
verbose: true,
timezone: 'America/New_York'
});scheduler.on('* * 25th sat 7', () => {
console.log('this function executes every minute on July 25th');
});scheduler.on('04:08pm 25th sat 7', () => {
console.log('this function executes at 04:08PM on July 25pth');
});scheduler.on('*/4 0,12 1 */2 *', () => {
console.log('at every 4th minute past hour 0 and 12 on day-of-month 1 in every 2nd month');
});scheduler.on({
id: 3,
schedule: {
hours: 9,
minutes: 0,
greenwich: 'am',
month: 5
}
}, () => {
console.log('this function executes every day of May at 09:00AM');
});// disables the execution of the cron job "0"
scheduler.disable(0);// removes the job "1" from the list of executing jobs
scheduler.rm(1);// returns a list of all jobs in execution
scheduler.list();// returns only jobs who were executed once
console.log(scheduler.list({ executed: true }));
#+end_src