Emmanuil 73a9f0ffcf 20.07.2020 | %!s(int64=4) %!d(string=hai) anos | |
---|---|---|
.. | ||
index.js | %!s(int64=4) %!d(string=hai) anos | |
license | %!s(int64=4) %!d(string=hai) anos | |
package.json | %!s(int64=4) %!d(string=hai) anos | |
readme.md | %!s(int64=4) %!d(string=hai) anos |
Mimic a Node.js HTTP response stream
$ npm install mimic-response
const stream = require('stream');
const mimicResponse = require('mimic-response');
const responseStream = getHttpResponseStream();
const myStream = new stream.PassThrough();
mimicResponse(responseStream, myStream);
console.log(myStream.statusCode);
//=> 200
Type: Stream
Type: Stream
Any stream.
MIT © Sindre Sorhus