Initial commit
This commit is contained in:
19
themes/keepit/node_modules/stream-transform/samples/module.async.js
generated
vendored
Normal file
19
themes/keepit/node_modules/stream-transform/samples/module.async.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
const transform = require('..')
|
||||
|
||||
transform([
|
||||
['1','2','3','4'],
|
||||
['a','b','c','d']
|
||||
], function(data, callback){
|
||||
setImmediate(function(){
|
||||
data.push(data.shift())
|
||||
callback(null, data.join(',')+'\n')
|
||||
})
|
||||
}, {
|
||||
parallel: 20
|
||||
})
|
||||
.pipe(process.stdout)
|
||||
|
||||
// Output:
|
||||
// 2,3,4,1
|
||||
// b,c,d,a
|
||||
Reference in New Issue
Block a user