imajin/node_modules/mimic-response
2026-01-10 04:52:11 -08:00
..
index.js chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
license chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
package.json chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00
readme.md chore(imajin): 🔧 🛏️ update package.json and README.md 2026-01-10 04:52:11 -08:00

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