strom/samples/concat.js

13 lines
314 B
JavaScript
Raw Normal View History

2018-12-04 06:30:38 +00:00
const { Readable } = require("stream");
2018-11-29 04:59:24 +00:00
const Mhysa = require("mhysa");
2018-11-26 01:00:37 +00:00
2018-12-04 06:30:38 +00:00
const source1 = new Readable();
const source2 = new Readable();
Mhysa.concat(source1, source2).pipe(process.stdout);
source1.push("a1 ");
source2.push("c3 ");
source1.push("b2 ");
source2.push("d4 ");
2018-12-04 06:30:38 +00:00
source1.push(null);
source2.push(null);