jack e1a2621c78 update | 2 jaren geleden | |
---|---|---|
.. | ||
index.js | 2 jaren geleden | |
license | 2 jaren geleden | |
package.json | 2 jaren geleden | |
readme.md | 2 jaren geleden |
Convert bytes to a human readable string:
1337
→1.34 kB
Useful for displaying file sizes for humans.
-
Note that it uses base-10 (eg. kilobyte).
Read about the difference between kilobyte and kibibyte.
$ npm install --save pretty-bytes
const prettyBytes = require('pretty-bytes');
prettyBytes(1337);
//=> '1.34 kB'
prettyBytes(100);
//=> '100 B'
MIT © Sindre Sorhus