I understand that a process that I spawn with require('child_process').spawn() 
*has* three streams: stdin, stdout, stderr.

http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options

But I've now read about require('stream').Transform and it feels like for 
certain types of programs (compression programs like bzip2 or image conversion 
programs like ImageMagick) I would want the spawned process to *be* a stream -- 
a transform stream.

http://nodejs.org/api/stream.html#stream_class_stream_transform

I've tried to find examples of how to wrap a spawned child process in a 
transform stream, and I haven't found any, which makes me think I'm going about 
this the wrong way.

I want to be able to do something like this:

var rs; // a readable stream, maybe a file
var ws; // a writable stream, maybe an http response
var convert; // a transform stream that uses ImageMagick's convert program
rs.pipe(convert).pipe(ws);

Am I wrong to want this?
If not, how to I do this?

-- 
-- 
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, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to