Skip to content

Instantly share code, notes, and snippets.

@brycebaril
Last active December 31, 2015 16:59
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 brycebaril/b77cc4e8c280d1f9cb76 to your computer and use it in GitHub Desktop.
Save brycebaril/b77cc4e8c280d1f9cb76 to your computer and use it in GitHub Desktop.
var spigot = require("stream-spigot")
var through2 = require("through2")
var terminus = require("terminus")
spigot(["a", "b", "c"])
.pipe(through2(function (chunk, encoding, callback) {
console.log("spied chunk " + chunk.toString())
this.push(chunk)
callback()
}))
.pipe(terminus.concat(function (chunks) {
console.log("got: " + chunks.toString())
}))
// spied chunk a
// spied chunk b
// spied chunk c
// got: [object Uint8Array]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment