mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
12 lines
357 B
TypeScript
12 lines
357 B
TypeScript
/// <reference path="../node/node.d.ts" />
|
|
/// <reference path="batch-stream.d.ts" />
|
|
|
|
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.
|