DefinitelyTyped/types/pumpify/pumpify-tests.ts
Ankur Oberoi e178856691 pumpify: add ctor args, duplexify members, tests (#25524)
* pumpify: add ctor args, duplexify members, tests

* pumpify: add autoDestroy to PumpifyFactoryOptions
2018-05-07 14:09:10 -07:00

21 lines
482 B
TypeScript

import * as Pumpify from 'pumpify';
import { Duplex, Transform, PassThrough, Writable } from 'stream';
new Pumpify();
new Pumpify(new Writable(), new Writable());
const pumpify = new Pumpify([new Writable(), new Writable()]);
class Pumpy extends Pumpify {
constructor() {
super();
const dup1 = new Duplex();
const dup2 = new Transform();
this.setPipeline(dup1, dup2);
}
}
const pumpy = new Pumpy();
pumpy.pipe(new PassThrough());
pumpify.setPipeline(pumpy);