run-series
Advanced tools
Comparing version 0.5.0 to 1.0.0
24
index.js
@@ -1,2 +0,22 @@ | ||
module.exports = require('./series') | ||
module.exports.waterfall = require('./waterfall') | ||
module.exports = function (tasks, cb) { | ||
var current = 0 | ||
var results = [] | ||
cb = cb || function () {} | ||
function done (err, result) { | ||
if (err) return cb(err, results) | ||
results.push(result) | ||
if (++current >= tasks.length) { | ||
cb(null, results) | ||
} else { | ||
tasks[current](done) | ||
} | ||
} | ||
if (tasks.length) { | ||
tasks[0](done) | ||
} else { | ||
cb(null, []) | ||
} | ||
} |
{ | ||
"name": "run-series", | ||
"description": "Run an array of functions in series", | ||
"version": "0.5.0", | ||
"version": "1.0.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Feross Aboukhadijeh", |
var series = require('../') | ||
var test = require('tape') | ||
test('require(run-series/series) usage', function (t) { | ||
t.equal(series, require('../series')) | ||
t.end() | ||
}) | ||
test('functions run in series', function (t) { | ||
@@ -10,0 +5,0 @@ t.plan(4) |
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
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 v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
98832
10
126