JASC is a tiny and simple library for Node.js concurrency. It's inspired by async but intended to be ultra slim and pretty to use.
jasc.seq
jasc.each
jasc.map
Invoke jasc.seq
to create a new chained list of functions. Pass true
on the last invokation to run the sequence.
var s = jasc.seq();
s(doSomething);
s(function(arg, arg, fn) {
processResults(arg, arg, fn);
});
s(console.log, true); // The last function requires a true flag
Loops over an array and runs fn
for each element.
jasc.map(['foo', 'bar'], function(fn) {
}, function(err, result) {
});
Similar to map but does not return results. Useful to set variables in outer scope.
jasc.each(['foo', 'bar'], function(fn) {
}, function(err) {
});