buffr

0.1.2 • Public • Published

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);

Dependencies (0)

    Dev Dependencies (5)

    Package Sidebar

    Install

    npm i buffr

    Weekly Downloads

    3

    Version

    0.1.2

    License

    MIT

    Last publish

    Collaborators

    • jcrugzz