This repository has been archived on 2024-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
smart-tag/node_modules/mimic-response
alexmorenograu 12b3da8efd first commit 2021-03-10 16:27:43 +01:00
..
index.js first commit 2021-03-10 16:27:43 +01:00
license first commit 2021-03-10 16:27:43 +01:00
package.json first commit 2021-03-10 16:27:43 +01:00
readme.md first commit 2021-03-10 16:27:43 +01:00

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.

License

MIT © Sindre Sorhus