Bits2Bytes
Convert various units from bits to petabytes.
Installation
use npm:
Local Install :
npm install bits2bytes
Globall Install:
npm install -g bits2bytes
Using
After complete installation, you can include ./bits2bytes/index.js
in your script by using var bits2bytes = require(./bits2bytes/index.js);
If you install bits2bytes globally, you can just use var bits2bytes = require('bits2bytes');
Bits2Bytes calculate all data units to each other, by just enter one unit and a value.then it return you an array or json of converted data.
For convert use convert()
function.this function have tree parameters:
convert(value,unit,format)
-
value: value for conversion (integer)
-
unit: unit of previous value (string - case sensitive)
b
biteB
Bytekb
killobitkB
killobytemb
megabitmB
megabytegb
gigabitgB
gigabytetb
terabittB
terabytepb
petabitpB
petabyte
-
format: format of return (string)
array
return array of conversion.json
return strigify json.- You can return strigified json to JSON Object by using var jsonObject = JSON.parse( RETURN_VALUE )
Example
var bits2bytes = ;//or if install local use require('./bits2bytes/index.js') //returnconsole; //console; //return array like above lineconsole;
Other apps
I previously created another platform app...if you enjoy Bits2Bytes you can use it on other platform.
- Firefox Addon
- Wordpress Plugin
- You can convert Bits2Bytes for using on browser with Browserify.
browserify index.js -o browseify_bits2bytes.js
Found a bug?
If you find a bug or need a feature Open a github issue.
License
MIT License ( https://opensource.org/licenses/MIT )