buffer-stream

0.0.1 • Public • Published

buffer-stream

A duplex stream that buffers writes

Example

var BufferStream = require("buffer-streams")
 
var buffer = BufferStream().buffer()
 
buffer.write("stuff")
 
buffer.on("data", doStuff)
 
someTimeLater(function (stream) {
    // Oh we have a stream
    // Empty the buffer onto the stream
    // Further writes to the buffer go directly to the stream
    // Any data the stream emits get's re-emitted on the buffer
    buffer.empty(stream)
})

Installation

npm install buffer-stream

Contributors

  • Raynos

MIT Licenced

/buffer-stream/

    Package Sidebar

    Install

    npm i buffer-stream

    Weekly Downloads

    0

    Version

    0.0.1

    License

    none

    Last publish

    Collaborators

    • raynos