Skip to content
Mimic a Node.js HTTP response stream
Branch: master
Clone or download
Latest commit bffa6bf Jan 20, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
.npmrc
.travis.yml
index.js Update the list of known properties Jan 20, 2019
license
package.json
readme.md
test.js

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

You can’t perform that action at this time.