1.0.2 • Published 7 years ago

pon-task-cron v1.0.2

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
7 years ago

pon-task-cron

Build Status npm Version JS Standard

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

ParamtypeDescription
whenstring|DateWhen to invoke job
jobfunction|stringJob function or executable file
optionsObjectOptional settings

License

This software is released under the Apache-2.0 License.

Links

1.0.2

7 years ago