/usr/share/doc/node-batch/examples/parallel.js is in node-batch 0.5.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | /**
* Module dependencies.
*/
var Batch = require('..');
var n = 10;
var batch = new Batch;
while (n--) {
(function(n){
batch.push(function(done){
console.log(' start : %s', n);
setTimeout(function(){
console.log(' done : %s', n);
done();
}, 200);
})
})(n);
}
batch.end();
|