1.0.7 • Published 3 years ago

expressweb-scheduler v1.0.7

Weekly downloads
10
License
ISC
Repository
-
Last release
3 years ago

Setup

ExpressWebJs Scheduler

The software utility cron also known as cron job is a time-based job scheduler in computer operating systems. Users that set up and maintain software environments use cron to schedule jobs to run periodically at fixed times, dates, or intervals. ExpressWebJs Scheduler makes that really easy to achieve.

Getting started

npm install --save expressweb-scheduler

import expressweb-scheduler and schedule a task


  const scheduler = require("expressweb-scheduler");

  scheduler.command('sendNewsletter').everySecond().run();

You can also run a closure function using the call method

  scheduler.call(()=>{
    console.log('this is a closure that is been run every seconds')
  }).everySecond().run();


You can also use the cron method:


  const scheduler = require("expressweb-scheduler");

  scheduler.command('sendNewsletter').cron('* * * * * *').run();


Allowed fields in cron method

# ┌────────────── second (optional)
# │ ┌──────────── minute
# │ │ ┌────────── hour
# │ │ │ ┌──────── day of month
# │ │ │ │ ┌────── month
# │ │ │ │ │ ┌──── day of week
# │ │ │ │ │ │
# │ │ │ │ │ │
# * * * * * *

Allowed Values And Schedule Frequency Options

We've already seen a few examples of how you may configure a task to run at specified intervals. However, there are many more task schedule frequencies that you may assign to a task:

Visit ExpressWebJs Documentation site for more info.

ExpressWebJs is a Node FrameWork with expressive and organised syntax that runs on all major operating systems. It provides the starting point for creating your node project, allowing you to focus more on developing your amazing solution.

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago