Created
March 5, 2019 06:40
-
-
Save Jonahss/700ecf7334f83d23cf0dfb49cd369764 to your computer and use it in GitHub Desktop.
multiple-piping-is-concatenated
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let streamify = require('stream-generators') | |
let infiniteWordStream = (word) => { | |
return streamify(function*() { | |
for (let i = 0; i < 1000; i++) | |
yield word | |
}) | |
} | |
infiniteWordStream('1').pipe(process.stdout) | |
infiniteWordStream('0').pipe(process.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment