Format bit input. Options of a function and class
MIT
NPM:
npm install bit-formater
import { formatBytes, byteFormater } from 'bit-formater';
let x = formatBytes(234567543, 2);
let y = new byteFormater();
let r = y.add(12346765432);
console.log(r); // '12 GB 346 MB 765 KB and 432 Bytes downloaded'
r = y.add(93484952492834);
console.log(r); // '93 TB 496 GB 1298 MB 1258 KB and 1266 Bytes downloaded'
# Fork this repo, then
npm install
npm run watch
# add tests, make changes, pass tests ... then [ctrl+c]
npm run publish
Update typings.json/version
to match the source version you are typing against.
e.g. if you are creating typings for bit-formater@0.5.0
, then:
// typings.json
{
"version": "0.5.0"
// ...
}