Skip to content

Instantly share code, notes, and snippets.

@Jonahss
Created March 5, 2019 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jonahss/700ecf7334f83d23cf0dfb49cd369764 to your computer and use it in GitHub Desktop.
Save Jonahss/700ecf7334f83d23cf0dfb49cd369764 to your computer and use it in GitHub Desktop.
multiple-piping-is-concatenated
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