Hi,

I want to use mikeal's request to stream down large resources from the web. 
I want to determine automatically the file type csv/json/xml and if it's 
compressed so i can stream it down to the correct handler.
Something like this:

var input = request(<url>);
var output1 = *(input is gzipped)* ? input.pipe(<gzip inflator>) : input;
var output2 =* (output1 is xml)* ? output1.pipe(<xml processor>) : 
                             *(output1 is json)* ? output1.pipe(<json 
processor>) :
                                       * (output1 is csv)* ? 
output1.pipe(<csv processor>): output1 ;
output2.pipe(<whatever>);

The code has flows as `pipe` doesn't return a readable stream, but you get 
the picture. 
Is there any way to determine the bolded conditionals?

Thanks,
Alex

-- 
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

Reply via email to