Comparing version 0.1.2 to 0.1.3
@@ -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 @@ } |
{ | ||
"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); | ||
} | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
359
66
0
15048
7
Updatednodeunit@=0.5.2