@onehilltech/blueprint-cron

4.74.1 • Public • Published

blueprint-cron

Blueprint module that adds cron job support to the application

Features

  • Define cron jobs as individual objects
  • Wrapper for node-cron.

Installation

yarn add blueprint-cron

or

npm install blueprint-cron --save

Basic Usage

All cron jobs are located in app/cronjobs, and must extend the Job class that can be imported from the @onehilltech/blueprint-cron module. The extended Job class must define the time property, which is a cron time pattern, and the onTick() method, which is called when the job is scheduled to run.

// app/cronjobs/basic.js

const { Job } = require ('@onehilltech/blueprint-cron');

module.exports = Job.extend ({
  time: '* * * * * *',

  onTick () {
    
  }
});

Happy Coding!

Package Sidebar

Install

npm i @onehilltech/blueprint-cron

Weekly Downloads

3

Version

4.74.1

License

Apache-2.0

Unpacked Size

50.2 kB

Total Files

19

Last publish

Collaborators

  • onehilltech