Skip to content

CraigglesO/bit-formater

Repository files navigation

Typed Bit Formater Build Status

Greenkeeper badge npm

Format bit input. Options of a function and class

LICENSE

MIT

install

NPM: npm install bit-formater

How to Use

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'

Contributing

# Fork this repo, then
npm install

npm run watch

# add tests, make changes, pass tests ... then [ctrl+c]
npm run publish

Updating

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"
  // ...
}

About

Given the size and type, convert down or up

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published