pretty-bytes
Convert bytes to a human readable string:
1337
→1.34 kB
Useful for displaying file sizes for humans.
Note that it uses base-10 (e.g. kilobyte).
Read about the difference between kilobyte and kibibyte.
Install
$ npm install --save pretty-bytes
Usage
const prettyBytes = ; ;//=> '1.34 kB' ;//=> '100 B'
Related
- pretty-bytes-cli - CLI for this module
License
MIT © Sindre Sorhus