nuǝW pǝuoᴉʇᴉsoԀ ʎlǝʌᴉʇɐƃǝN

    mimic-response
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published

    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

    Install

    npm i mimic-response@1.0.1

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    3.58 kB

    Total Files

    4

    Last publish

    Collaborators

    • sindresorhus