mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
9 lines
270 B
TypeScript
9 lines
270 B
TypeScript
import fs = require('fs');
|
|
import BatchStream = require('batch-stream');
|
|
|
|
var batch = new BatchStream({ size : 5 });
|
|
var stream = fs.createReadStream('/etc/passwd');
|
|
|
|
stream
|
|
.pipe(batch)
|
|
.pipe(fs.createWriteStream('./test.out')); // deals with array input from pipe.
|