Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-schedule

Package Overview
Dependencies
Maintainers
4
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-schedule - npm Package Compare versions

Comparing version 1.2.5 to 1.3.0

test/.eslintrc

17

lib/schedule.js

@@ -170,8 +170,8 @@

Job.prototype.invoke = function() {
Job.prototype.invoke = function(fireDate) {
if (typeof this.job == 'function') {
this.setTriggeredJobs(this.triggeredJobs() + 1);
this.job();
this.job(fireDate);
} else {
this.job.execute();
this.job.execute(fireDate);
}

@@ -495,6 +495,11 @@ };

function runOnDate(date, job) {
var now = (new Date()).getTime();
var now = Date.now();
var then = date.getTime();
return lt.setTimeout(job, (then < now ? 0 : then - now));
return lt.setTimeout(function() {
if (then > Date.now())
runOnDate(date, job);
else
job();
}, (then < now ? 0 : then - now));
}

@@ -540,3 +545,3 @@

job.invoke();
job.invoke(cinv.fireDate instanceof CronDate ? cinv.fireDate.toDate() : cinv.fireDate);
job.emit('run');

@@ -543,0 +548,0 @@ });

{
"name": "node-schedule",
"version": "1.2.5",
"version": "1.3.0",
"description": "A cron-like and not-cron-like job scheduler for Node.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -61,3 +61,3 @@ # Node Schedule

┬ ┬ ┬ ┬ ┬ ┬
│ │ │ │ │ |
│ │ │ │ │ │
│ │ │ │ │ └ day of week (0 - 7) (0 or 7 is Sun)

@@ -93,2 +93,9 @@ │ │ │ │ └───── month (1 - 12)

You can also get when it is scheduled to run for every invocation of the job:
```js
var j = schedule.scheduleJob('0 1 * * *', function(fireDate){
console.log('This job was supposed to run at ' + fireDate + ', but actually ran at ' + new Date());
});
```
This is useful when you need to check if there is a delay of the job invocation when the system is busy, or save a record of all invocations of a job for audit purpose.
#### Unsupported Cron Features

@@ -95,0 +102,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc