1.1.0 • Published 2 years ago

tiny-byte-size v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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