tiny-byte-size
Dead simple, single file, tiny byte formatter
Last updated 4 years ago by mafintosh .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tiny-byte-size 
SYNC missed versions from official npm registry.

tiny-byte-size

Dead simple, no configuration needed, tiny byte formatter

npm install tiny-byte-size

Usage

const byteSize = require('tiny-byte-size')

console.log(byteSize(100)) // 100B
console.log(byteSize(1000)) // 1kB
console.log(byteSize(1100)) // 1.1kB
console.log(byteSize(10101010)) // 10.1MB
console.log(byteSize.perSecond(10101010)) // 10.1MB/s
console.log(byteSize.perSecond(10101010, 500)) // 20.2MB/s

License

MIT

Current Tags

  • 1.1.0                                ...           latest (4 years ago)

3 Versions

  • 1.1.0                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Total 6
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (0)
None
Dev Dependencies (2)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE