npm.io
0.1.0 • Published 14 years ago

numeric-buffer

Licence
Version
0.1.0
Deps
0
Vulns
0
Weekly
0

#NumericBuffer

numeric-buffer is a tiny module for filling a Node.js Buffer with the binary representation of an integer. You can do this in 0.6.0 with buffer.writeUInt8, but not in 0.4.x.

##Installation

npm install numeric-buffer

##Usage

(function () {
  "use strict";
  var numericBuffer = require('numeric-buffer');
  var buf = numericBuffer(255);
  // buf is now a Buffer of length 1
  console.log(buf[0]);
  //255
}());

Keywords