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+