Socket
Socket
Sign inDemoInstall

cron

Package Overview
Dependencies
1
Maintainers
1
Versions
66
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.1.3

5

lib/cron.js

@@ -102,3 +102,3 @@ /**

function CronJob(cronTime, event) {
function CronJob(cronTime, event, oncomplete) {

@@ -113,2 +113,3 @@ if (!(this instanceof CronJob)) {

this.initiated = false;
this.oncomplete = oncomplete;

@@ -128,3 +129,3 @@ this.clock();

if (typeof this.events[i] === 'function') {
this.events[i]();
this.events[i](this.oncomplete);
}

@@ -131,0 +132,0 @@ }

17

package.json
{
"name": "cron",
"description": "CronJob's for your node",
"version": "0.1.2",
"version": "0.1.3",
"author": "James Padolsey (http://github.com/jamespadolsey)",
"contributors": [
{
"name": "Nick Campbell",
"web": "http://github.com/ncb000gt"
}
],
"bugs" : {
"mail" : "",
"web" : "http://github.com/ncb000gt/node-cron/issues"

@@ -28,3 +21,3 @@ },

"dependencies": {
"nodeunit": "=0.5.1"
"nodeunit": "=0.5.2"
},

@@ -42,6 +35,8 @@ "licenses": [

"contributors": [
"Nick Campbell <nicholas.j.campbell@gmail.com> (http://github.com/ncb000gt)",
"Finn Herpich <> (http://github.com/ErrorProne)",
"Clifton Cunningham <> (http://github.com/cliftonc)",
"Eric Abouaf <> (http://github.com/neyric)"
"Clifton Cunningham <clifton.cunningham@gmail.com> (http://github.com/cliftonc)",
"Eric Abouaf <eric.abouaf@gmail.com> (http://github.com/neyric)",
"humanchimp <> (http://github.com/humanchimp)"
]
}

@@ -46,3 +46,3 @@ A NodeJS fork of [jamespadolsey's](http://github.com/jamespadolsey) [cron.js](http://github.com/jamespadolsey/cron.js).

Contributors (via git-count)
Contributors
===========

@@ -56,2 +56,3 @@

* neyric
* humanchimp

@@ -62,1 +63,7 @@ License

This is under a dual license, MIT and GPL. However, the author of cron.js hasn't specified which version of the GPL, once I know I'll update this project and the packaging files.
Trademarks?
============
Node.js™ is an official trademark of Joyent. This module is not formally related to or endorsed by the official Joyent Node.js open source or commercial project

@@ -14,2 +14,13 @@ var testCase = require('nodeunit').testCase,

},
'test second with oncomplete (* * * * * *)': function(assert) {
assert.expect(1);
new cron.CronJob('* * * * * *', function(done) {
done();
}, function () {
assert.ok(true);
});
setTimeout(function() {
assert.done();
}, 1000);
},
'test every second for 5 seconds (* * * * * *)': function(assert) {

@@ -24,2 +35,13 @@ assert.expect(5);

},
'test every second for 5 seconds with oncomplete (* * * * * *)': function(assert) {
assert.expect(5);
new cron.CronJob('* * * * * *', function(done) {
done();
}, function() {
assert.ok(true);
});
setTimeout(function() {
assert.done();
}, 5000);
},
'test every 1 second for 5 seconds (*/1 * * * * *)': function(assert) {

@@ -34,2 +56,13 @@ assert.expect(5);

},
'test every 1 second for 5 seconds with oncomplete (*/1 * * * * *)': function(assert) {
assert.expect(5);
new cron.CronJob('*/1 * * * * *', function(done) {
done();
}, function() {
assert.ok(true);
});
setTimeout(function() {
assert.done();
}, 5000);
},
'test every second for a range ([start]-[end] * * * * *)': function(assert) {

@@ -46,3 +79,17 @@ assert.expect(5);

}, 7000);
},
'test every second for a range with oncomplete ([start]-[end] * * * * *)': function(assert) {
assert.expect(5);
var d = new Date();
var s = d.getSeconds()+2;
var e = s + 4; //end value is inclusive
new cron.CronJob(s + '-' + e +' * * * * *', function(done) {
done();
}, function() {
assert.ok(true);
});
setTimeout(function() {
assert.done();
}, 7000);
}
});
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc