pon-task-cron
v1.0.2
Published
Cron task for pon
Downloads
3
Readme
pon-task-cron
Cron task for pon
Installation
$ npm install pon-task-cron --save
Usage
'use strict'
const pon = require('pon')
const ponTaskCron = require('pon-task-cron')
;(async () => {
let run = pon({
// Define job with crone time
'job:01': ponTaskCron('42 * * * *', () => {
console.log('Hey! A hour passed')
}),
// Specifying by date
'job:02': ponTaskCron(new Date('2020/01/12'), () => { /* ... */ })
})
run('job:*')
}).catch((err) => console.error(err))
Signatures
define(when, job, options) -> function
Define task
| Param | type | Description | | ---- | --- | ----------- | | when | string|Date | When to invoke job | | job | function|string | Job function or executable file | | options | Object | Optional settings |
License
This software is released under the Apache-2.0 License.