Narcissistic Pickle Meister
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

mutable-buffer

2.1.1 • Public • Published

mutable-buffer

NPM version Build Status Dependency Status Coverage percentage

A mutable buffer library for node.js

Install

$ npm install --save mutable-buffer

Usage

var MutableBuffer = require('mutable-buffer');
 
var buffer = new MutableBuffer(/* initialSize, blockSize */);
var result;
 
// use it like node Buffer
buffer.writeUInt8(8);
buffer.writeUInt16LE(0x1234);
 
buffer.write('hello');
buffer.write(otherBuffer);
 
// write a string to the buffer utf8 encoded and adds a null character (\0) at the end.
buffer.writeCString('hello'); 
 
// write a char
buffer.writeChar('a');
 
// get size of mutable buffer
buffer.size();
 
// get current capacity of mutable buffer
buffer.capacity();
 
// return a sliced Buffer instance
result = buffer.join(); 
 
// or return a sliced Buffer instance and clear buffer
result = buffer.flush();
 
// clear manual 
buffer.clear();
 

License

MIT © taoyuan

Install

npm i mutable-buffer

DownloadsWeekly Downloads

733

Version

2.1.1

License

MIT

Unpacked Size

36.4 kB

Total Files

16

Last publish

Collaborators

  • avatar