async-waterfall
Advanced tools
Comparing version 0.1.1 to 0.1.2
{ | ||
"name": "async-waterfall", | ||
"repo": "es128/async-waterfall", | ||
"description": "Simple, isolated async waterfall module for JavaScript", | ||
"version": "0.1.1", | ||
"keywords": ["async", "waterfall"], | ||
"description": "Runs a list of async tasks, passing the results of each into the next one", | ||
"version": "0.1.2", | ||
"keywords": ["async", "waterfall", "tasks", "control", "flow"], | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "scripts": ["index.js"], |
{ | ||
"name": "async-waterfall", | ||
"repo": "es128/async-waterfall", | ||
"description": "Simple, isolated async waterfall module for JavaScript", | ||
"version": "0.1.1", | ||
"keywords": ["async", "waterfall"], | ||
"description": "Runs a list of async tasks, passing the results of each into the next one", | ||
"version": "0.1.2", | ||
"keywords": ["async", "waterfall", "tasks", "control", "flow"], | ||
"main": "index.js", | ||
@@ -8,0 +8,0 @@ "scripts": ["index.js"], |
14
index.js
@@ -6,6 +6,8 @@ // MIT license (by Elan Shanker). | ||
var nextTick = function (fn) { | ||
if (typeof process === 'undefined' || !(process.nextTick)) { | ||
if (typeof setImmediate === 'function') { | ||
setImmediate(fn); | ||
} else if (typeof process !== 'undefined' && process.nextTick) { | ||
process.nextTick(fn); | ||
} else { | ||
setTimeout(fn, 0); | ||
} else { | ||
process.nextTick(fn); | ||
} | ||
@@ -44,4 +46,3 @@ }; | ||
callback = function () {}; | ||
} | ||
else { | ||
} else { | ||
var args = Array.prototype.slice.call(arguments, 1); | ||
@@ -51,4 +52,3 @@ var next = iterator.next(); | ||
args.push(wrapIterator(next)); | ||
} | ||
else { | ||
} else { | ||
args.push(callback); | ||
@@ -55,0 +55,0 @@ } |
{ | ||
"name": "async-waterfall", | ||
"version": "0.1.1", | ||
"description": "Simple, isolated async waterfall module for JavaScript", | ||
"version": "0.1.2", | ||
"description": "Runs a list of async tasks, passing the results of each into the next one", | ||
"author": { | ||
@@ -18,4 +18,4 @@ "name": "Elan Shanker", | ||
"main": "./index", | ||
"keywords": ["async", "waterfall"], | ||
"keywords": ["async", "waterfall", "tasks", "control", "flow"], | ||
"dependencies": {} | ||
} |
@@ -35,14 +35,14 @@ # async-waterfall | ||
waterfall([ | ||
function(callback){ | ||
callback(null, 'one', 'two'); | ||
}, | ||
function(arg1, arg2, callback){ | ||
callback(null, 'three'); | ||
}, | ||
function(arg1, callback){ | ||
// arg1 now equals 'three' | ||
callback(null, 'done'); | ||
} | ||
function(callback){ | ||
callback(null, 'one', 'two'); | ||
}, | ||
function(arg1, arg2, callback){ | ||
callback(null, 'three'); | ||
}, | ||
function(arg1, callback){ | ||
// arg1 now equals 'three' | ||
callback(null, 'done'); | ||
} | ||
], function (err, result) { | ||
// result now equals 'done' | ||
// result now equals 'done' | ||
}); | ||
@@ -49,0 +49,0 @@ ``` |
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
6446