[nodejs] String Stream

2013-04-17 Thread Alan Gutierrez
I need a stream that will gather it's results in a buffer or string for testing. I'm sure that someone has written one already. -- Alan Gutierrez ~ @bigeasy -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You

Re: [nodejs] String Stream

2013-04-17 Thread Michael Nisi
Try event-stream https://github.com/dominictarr/event-stream On Wed, Apr 17, 2013 at 10:48 PM, Alan Gutierrez a...@prettyrobots.com wrote: I need a stream that will gather it's results in a buffer or string for testing. I'm sure that someone has written one already. -- Alan Gutierrez ~

Re: [nodejs] String Stream

2013-04-17 Thread Isaac Schlueter
Alan, You can use stream.Passthrough for this. That's exactly what it's for. var pt = new stream.Passthrough() pt.setEncoding('utf8') // for strings, if you are into that sort of thing pt.write('foo'); pt.write('bar\n'); pt.write('ghoulie goo'); pt.end() assert.equal(pt.read(),

Re: [nodejs] String Stream

2013-04-17 Thread Alan Gutierrez
On Wed, Apr 17, 2013 at 05:05:45PM -0500, Isaac Schlueter wrote: You can use stream.Passthrough for this. That's exactly what it's for. var pt = new stream.Passthrough() pt.setEncoding('utf8') // for strings, if you are into that sort of thing pt.write('foo'); pt.write('bar\n');

Re: [nodejs] String Stream

2013-04-17 Thread Michael Nisi
Awesome! Obviously I still have to get off old habits. -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups nodejs group. To post to this group,