Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
node-schedule
Advanced tools
The node-schedule npm package is a flexible cron-like and not-cron-like job scheduler for Node.js. It allows you to schedule jobs (arbitrary functions) for execution at specific dates, with optional recurrence rules. It is suitable for building job schedulers, task reminders, or any other automation based on time events.
One-time jobs
Schedule a job to be executed once at a specific date and time.
const schedule = require('node-schedule');
const date = new Date(2023, 3, 21, 5, 30, 0);
const job = schedule.scheduleJob(date, function() {
console.log('This job is run once at the specified date.');
});
Recurring jobs using cron-style scheduling
Schedule a job to be executed on a recurring basis using a cron string to specify the frequency.
const schedule = require('node-schedule');
const job = schedule.scheduleJob('*/5 * * * *', function() {
console.log('This job runs every 5 minutes.');
});
Recurring jobs using object literal syntax
Schedule a job using a more human-readable object literal syntax for setting the schedule.
const schedule = require('node-schedule');
const job = schedule.scheduleJob({hour: 14, minute: 30, dayOfWeek: 1}, function() {
console.log('This job runs at 2:30pm every Monday.');
});
Canceling jobs
Cancel a scheduled job before it is executed.
const schedule = require('node-schedule');
const job = schedule.scheduleJob('*/5 * * * *', function() {
console.log('This job will be canceled.');
});
job.cancel();
The 'cron' package is similar to node-schedule and is used for scheduling jobs to run at specific times or intervals. It uses the Unix cron string format to define schedules and is widely used for its simplicity and familiarity to those with Unix/Linux experience.
Agenda is a more feature-rich job scheduling library for Node.js. It supports persistence with MongoDB, which allows scheduled jobs to be stored and run across server restarts. It also offers more control over job queuing and locking, making it suitable for more complex scheduling needs.
Bull is a Redis-based queue system for Node.js. It is often used for job scheduling as well as for processing distributed jobs in the background. It offers advanced features like repeatable jobs, rate limiting, and job prioritization, making it a good choice for high-performance job processing.
Bree is a job scheduler for Node.js that supports cron, dates, ms (milliseconds), later, and human-friendly strings for job scheduling. It uses workers for parallel job processing and includes support for job timeouts and graceful cancellation. It's a modern alternative with a focus on reliability and concurrency.
Announcement: Node Schedule is looking for add additional collaborators with commit access. If you are actively involved in open source, ping Tejas Manohar (via email, Twitter, etc.) to express interest. Those who already contribute to the project are preferred.
node-schedule is a flexible cron-like and not-cron-like job scheduler for Node.js. It allows you to schedule jobs (arbitrary functions) for execution at specific dates, with optional recurrence rules. It only uses a single timer at any given time (rather than reevaluating upcoming jobs every second/minute).
Read more about the module's core functions on the About page of the wiki.
Check out our wonderful wiki for usage instructions.
This module was originally developed by Matt Patenaude, and is now maintained by Tejas Manohar and other wonderful contributors.
We'd love to get your contributions. Individuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit.
Before jumping in, check out our Contributing page on the wiki!
Copyright 2015 Matt Patenaude.
Licensed under the [MIT License] license.
FAQs
A cron-like and not-cron-like job scheduler for Node.
The npm package node-schedule receives a total of 637,961 weekly downloads. As such, node-schedule popularity was classified as popular.
We found that node-schedule demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.