You can use https://github.com/sidorares/exec-stream
var es = require('exec_stream'); var convert = es('imagemagick', ['options']);
rs.pipe(convert).pipe(ws);
On Friday, 14 June 2013 11:23:08 UTC+10, ryandesign wrote:
>
> 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.