sailor-module-crontab

1.0.1 • Public • Published

Sailor Module Crontab

Build Status Dependency status Dev Dependencies Status NPM Status

Schedule and run jobs like UNIX Crontab style

Install

npm install sailor-module-crontab

Usage

declare in config/crontab your jobs, like:

  • the key is the schedule job
  • the value is the function to exec

Example

Each minute write in terminal "Hello World"

module.exports.crontab =
 
  # eg: Print 'hello world' each minute 
  '* * * * * *': -> console.log 'Hello World'

Additional

Remember cron format:

* * * * * *
| | | | | |
| | | | | +-- Year              (range: 1900-3000)
| | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)

Check cron documentation for more information and examples.

MIT © sailorjs

Package Sidebar

Install

npm i sailor-module-crontab

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • kikobeats