1.2.0 • Published 10 months ago

schedule-pro v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Schedule Pro

  1. Introduction
  2. Schedule Sync Options
  3. Schedule Frequency Options
  4. Examples

Introduction

Schedule-Pro is a powerful and user-friendly Node.js library designed to effortlessly manage cron jobs. With its intuitive interface, it simplifies the implementation of scheduling recurring tasks, automating background processes, and executing time-based operations.

Schedule Sync Options

MethodDescription
wait( time ms )The task runs after the waiting time.
nextTenMinutes()Run the task at the beginning of the next 10 minutes.

Schedule Frequency Options

MethodDescription
once()Run the task once.
everyTime( time ms )Run the task every specified time.
everyMinute()Run the task every minute.
everyTwoMinutes()Run the task every two minutes.
everyThreeMinutes()Run the task every three minutes.
everyFourMinutes()Run the task every four minutes.
everyFiveMinutes()Run the task every five minutes.
everyTenMinutes()Run the task every ten minutes.
everyFifteenMinutes()Run the task every fifteen minutes.
everyThirtyMinutes()Run the task every thirty minutes.
everyHour()Run the task every hour.
everyTwoHours()Run the task every two hours.
everyThreeHours()Run the task every three hours.
everyFourHours()Run the task every four hour.
everySixHours()Run the task every six hours.
daily()Run the task every day.

Examples

Import the library:

const Schedule = require("schedule-pro");

Execute simple functions:

Schedule.job(test).everyMinute();

function test() {
    console.log('Test');
}

Execute functions with multiple arguments:

Schedule.job(message, 'Hello', 'world!').everyMinute();

function message(msg1, msg2) {
   console.log(msg1, msg2);
}

Use sync options

Schedule.job(message, 'Test', '1').wait(5000).everyFiveMinutes();
Schedule.job(message, 'Test', '2').nextTenMinutes().everyHour();

Run once after wait or sync option

Schedule.job(message, 'Test', '3').wait(10000).once();
1.2.0

10 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago