Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    buffrpublic

    buffr

    A sorta proper Duplex stream useful for piping into, duplicating and destroying. The reason this exists is because there is some weird timing issue in how back pressure is handled preventing bl from handling the case of being piped into and then piped somewhere else. This is super apparent when dealing with requests.

     
    var http = require('http');
    var buffr = require('buffr');
     
    // 
    // While this is not very useful, this will actually work and we will store the 
    // request in the `buf` stream if we need to duplicate and repipe. 
    // 
    http.createServer(function (req, res) {
      var buf = req.pipe(buffr())
      buf.pipe(res);
    }).listen(3000);

    install

    npm i buffr

    Downloadsweekly downloads

    4

    version

    0.1.2

    license

    MIT

    last publish

    collaborators

    • avatar