bhd

BHD Converter

npm install bhd
10 downloads in the last week
20 downloads in the last month

bhd

BHD converter

Use this, convert numbers from one mode to another.


Install

First, you should install node.js and npm
After that, use npm command: $ npm install bhd.

Install globally : $ npm install bhd -g


When use as a library

Example:

  // new BHD(from, to);
  var BHD = require('bhd');
  var bhd = new BHD(10, 2);  // convert from decimal to binary.
  console.log(bhd.convert(123));

or

  // bhd.convert(number, from, to);
  var BHD = require('bhd');
  var bhd = new BHD();
  console.log(bhd.convert(123, 10, 2));

When use at terminal

Example:

  $ bhd -f 10 -t 16 255         // convert from decimal to octal.

Test

test use mocha and should.js

  $ npm install
  $ npm test
npm loves you