remote-stream
Streaming remote api
Install
npm install remote-stream
Example
var rsave = require('remote-save');
var fs = require('fs')
var ws = fs.createWriteStream('./output');
var rsave_cb = rsave("http://localhost:3000/csv", cb);
function cb(result, details) {
console.log(result)
console.log(details)
}
// pipe to next
rsave_cb.pipe(ws)
API
rsave(url, options, cb)
Parameters
- url: a url to your http
- options: Readable stream options(optional): http://nodejs.org/api/stream.html#stream_class_stream_readable_1
- cb: After done will emit the callback function with a result argument and a some http response details. Details including things below.
- statusCode
- url
- method
- header
- httpVersion
License
MIT @chilijung