+12
-2
| language: node_js | ||
| node_js: | ||
| - 0.8 | ||
| - 0.10 | ||
| - "0.12" | ||
| - "iojs" | ||
| - "4" | ||
| - "6" | ||
| notifications: | ||
| email: | ||
| on_success: change | ||
| on_failure: change | ||
| sudo: false | ||
| after_success: | ||
| - npm install -g codecov | ||
| - codecov |
+2
-3
@@ -1,4 +0,3 @@ | ||
| var EventEmitter = require('events').EventEmitter | ||
| , util = require('util') | ||
| ; | ||
| var EventEmitter = require('events').EventEmitter; | ||
| var util = require('util'); | ||
@@ -5,0 +4,0 @@ |
+11
-8
| { | ||
| "name": "timequeue", | ||
| "description": "A queue with custom concurrency and time limits.", | ||
| "keywords": ["queue", "flow", "time"], | ||
| "version": "0.2.2", | ||
| "keywords": [ | ||
| "queue", | ||
| "flow", | ||
| "time" | ||
| ], | ||
| "version": "0.2.3", | ||
| "repository": { | ||
@@ -13,3 +17,3 @@ "type": "git", | ||
| "scripts": { | ||
| "test": "mocha -R spec test/*-test.js" | ||
| "test": "istanbul cover node_modules/.bin/_mocha -- test/*-test.js" | ||
| }, | ||
@@ -20,8 +24,7 @@ "directories": { | ||
| "devDependencies": { | ||
| "mocha": "x" | ||
| "istanbul": "*", | ||
| "mocha": "*", | ||
| "sinon": "*" | ||
| }, | ||
| "licenses": [ { | ||
| "type": "MIT", | ||
| "url" : "http://github.com/fent/timequeue.js/raw/master/LICENSE" | ||
| }] | ||
| "license": "MIT" | ||
| } |
+4
-1
@@ -1,5 +0,8 @@ | ||
| # timequeue.js [](http://travis-ci.org/fent/timequeue.js) | ||
| # timequeue.js | ||
| A queue with custom concurrency and time limits. Inspired by [caolan/async#queue](https://github.com/caolan/async#queue), but with variable number of arguments in the worker, events, and with optional time limits. | ||
| [](http://travis-ci.org/fent/timequeue.js) | ||
| [](https://gemnasium.com/fent/timequeue.js) | ||
| [](https://codecov.io/gh/fent/timequeue.js) | ||
@@ -6,0 +9,0 @@ # Usage |
+14
-4
@@ -1,4 +0,4 @@ | ||
| var TimeQueue = require('..') | ||
| , assert = require('assert') | ||
| ; | ||
| var TimeQueue = require('..'); | ||
| var assert = require('assert'); | ||
| var sinon = require('sinon'); | ||
@@ -10,2 +10,6 @@ | ||
| var clock; | ||
| before(function() { clock = sinon.useFakeTimers(); }); | ||
| after(function() { clock.restore(); }); | ||
| function runTest(type, worker) { | ||
@@ -15,3 +19,4 @@ describe('Create a queue with a time limit with ' + type, function() { | ||
| it('Amount of concurrent tasks are not executed over the time limit', function(done) { | ||
| it('Amount of concurrent tasks are not executed over the time limit', | ||
| function(done) { | ||
| var tid, n = 0, m = 0, timedOut = true; | ||
@@ -33,2 +38,5 @@ | ||
| }, every - 4); // setTimeout lags by 4ms on avg | ||
| process.nextTick(function() { | ||
| clock.tick(every); | ||
| }); | ||
| } | ||
@@ -58,2 +66,3 @@ } | ||
| setTimeout(callback.bind(null, n), ms); | ||
| clock.tick(ms); | ||
| }); | ||
@@ -64,2 +73,3 @@ | ||
| setTimeout(callback.bind(null, n), ms); | ||
| clock.tick(ms); | ||
| }); |
+25
-3
@@ -1,4 +0,3 @@ | ||
| var TimeQueue = require('..') | ||
| , assert = require('assert') | ||
| ; | ||
| var TimeQueue = require('..'); | ||
| var assert = require('assert'); | ||
@@ -51,2 +50,11 @@ | ||
| }); | ||
| describe('With default options', function() { | ||
| var q = new TimeQueue(process.nextTick.bind(process)); | ||
| it('Has defaults set', function() { | ||
| assert.equal(q.concurrency, 1); | ||
| assert.equal(q.every, 0); | ||
| assert.equal(q.timeout, 0); | ||
| }); | ||
| }); | ||
| }); | ||
@@ -143,2 +151,16 @@ | ||
| describe('Create a queue with a callback called twice', function() { | ||
| it('Throws an error', function(done) { | ||
| var q = new TimeQueue(function(callback) { | ||
| assert.throws(function() { | ||
| callback(); | ||
| callback(); | ||
| }, /should only be called once/); | ||
| done(); | ||
| }); | ||
| q.push(); | ||
| }); | ||
| }); | ||
| describe('Create a queue then call its `die` method', function() { | ||
@@ -145,0 +167,0 @@ var n = 0; |
@@ -1,4 +0,3 @@ | ||
| var TimeQueue = require('..') | ||
| , assert = require('assert') | ||
| ; | ||
| var TimeQueue = require('..'); | ||
| var assert = require('assert'); | ||
@@ -5,0 +4,0 @@ |
+13
-4
@@ -1,4 +0,4 @@ | ||
| var TimeQueue = require('..') | ||
| , assert = require('assert') | ||
| ; | ||
| var TimeQueue = require('..'); | ||
| var assert = require('assert'); | ||
| var sinon = require('sinon'); | ||
@@ -20,4 +20,11 @@ | ||
| describe('With tasks that lag', function() { | ||
| var q = new TimeQueue(function(a, b, callback) {}, { timeout: 50 }); | ||
| var clock; | ||
| before(function() { clock = sinon.useFakeTimers(); }); | ||
| after(function() { clock.restore(); }); | ||
| /* jshint unused: false */ | ||
| var q = new TimeQueue(function(a, b, callback) { | ||
| setTimeout(callback, 100); | ||
| }, { timeout: 50 }); | ||
| it('Should throw an error', function(done) { | ||
@@ -32,2 +39,3 @@ q.push(3, 4); | ||
| }); | ||
| clock.tick(100); | ||
| }); | ||
@@ -43,4 +51,5 @@ | ||
| }); | ||
| clock.tick(50); | ||
| }); | ||
| }); | ||
| }); |
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
17617
9.25%443
8.31%116
2.65%3
-25%3
200%