strom/samples/concat.js

13 lines
322 B
JavaScript
Raw Normal View History

2018-12-04 06:30:38 +00:00
const { Readable } = require("stream");
2020-07-04 15:06:41 +00:00
const strom = require("strom").strom();
2018-11-26 01:00:37 +00:00
2018-12-04 06:30:38 +00:00
const source1 = new Readable();
const source2 = new Readable();
2020-07-04 04:08:31 +00:00
strom.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);