Emmanuil 73a9f0ffcf 20.07.2020 il y a 4 ans
..
index.js 73a9f0ffcf 20.07.2020 il y a 4 ans
license 73a9f0ffcf 20.07.2020 il y a 4 ans
package.json 73a9f0ffcf 20.07.2020 il y a 4 ans
readme.md 73a9f0ffcf 20.07.2020 il y a 4 ans

readme.md

mimic-response Build Status

Mimic a Node.js HTTP response stream

Install

$ npm install mimic-response

Usage

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

API

mimicResponse(from, to)

from

Type: Stream

Node.js HTTP response stream.

to

Type: Stream

Any stream.

Related

License

MIT © Sindre Sorhus