NPM Needs: pretty-bytes
What Is It?
pretty-bytes
is a utility used to convert an integer form of bytes to a more human readable form (bytes to kilobytes, for example). pretty-bytes-cli
is a command line wrapper for the same package.
Usage Examples
import prettyBytes from 'pretty-bytes'
prettyBytes(100)
// '100 B'
prettyBytes(1650)
// '1.65 kB'
More Info
- Github Repo: sindresorhus/pretty-bytes
- Author: Sindre Sorhus
If you liked this article and think others should read it, please share it on Twitter!