Skip to content

Instantly share code, notes, and snippets.

@themasch
Created May 3, 2013 16:59
Show Gist options
  • Select an option

  • Save themasch/5511254 to your computer and use it in GitHub Desktop.

Select an option

Save themasch/5511254 to your computer and use it in GitHub Desktop.
Just a quick scribble..
var stream = new StreamThingy()
stream.transform = myCrazyFormater
io.sockets.on('connection', function(socket) {
stream.add(socket)
})
stream.pipe(process.stdout)
// // //
// stream works in object mode
// the fransform object receives an object which contains the sending stream and the received message
// every message emited by the transformer is passed to all clients execpt the sending one
// // //
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment