chrisdrakeford 9c87c1307d first commit %!s(int64=3) %!d(string=hai) anos
..
index.js 9c87c1307d first commit %!s(int64=3) %!d(string=hai) anos
license 9c87c1307d first commit %!s(int64=3) %!d(string=hai) anos
package.json 9c87c1307d first commit %!s(int64=3) %!d(string=hai) anos
readme.md 9c87c1307d first commit %!s(int64=3) %!d(string=hai) anos

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