1.0.1 • Published 9 years ago
stream-res v1.0.1
stream-res
Pipe a stream to an HTTP response
Installation
$ npm i stream-res --save
Usage
var fs = require('fs');
var streamRes = require('stream-res');
app.get('/', function(req, res, next) {
var stream = fs.createReadStream('./test.html');
streamRes(res, stream, function(err) {
if (err) next(err);
else {
console.log('file test.html has been piped to client');
}
});
});