Node.js Buffer.alloc
var buffer = new Buffer.alloc(256); length = buffer.write('A small example showing buffer'); console.log('octets used are:' + length);