Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Writes buffered data to files.
JavaScript
tree: 2b2376446b

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
build
examples
src
test
.gitignore
LICENSE
README.md

README.md

Node BufferedWriter

Fully configurable buffered writer for node.js

Show me! | Availability | Compatibility | Documentation

Version: 0.1.11

When you need to write a file you typically write the content in little chunks at a time. To avoid multiple calls to the underlying I/O layer you need to use a piece of memory called "buffer", so instead of writting directly to the disk, you write to the buffer and when it is filled the content is written to disk. Doing this you win performance.

This library allows you to write files using internal buffers, so you don't have to worry about them.

Show me!

var BufferedWriter = require ("buffered-writer");

new BufferedWriter ("file")
    .on ("error", function (error){
        console.log (error);
    })

    .write ([0x00, 0x01, 0x02], 0, 3) //Writes 0x00, 0x01, 0x02
    .write (new Buffer ([0x03, 0x04]), 1, 1) //Writes 0x04
    .write (0x0506) //Writes 0x05, 0x06
    .close ();

Availability

Via npm:

npm install buffered-writer

Compatibility

✔ Node 0.4.10+


Documentation

Reference
Examples
Change Log
MIT License

Something went wrong with that request. Please try again.