vlad 6f123ff03e 18.07 | 6 лет назад | |
---|---|---|
.. | ||
index.js | 6 лет назад | |
license | 6 лет назад | |
package.json | 6 лет назад | |
readme.md | 6 лет назад |
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.
$ npm install --save pretty-bytes
const prettyBytes = require('pretty-bytes');
prettyBytes(1337);
//=> '1.34 kB'
prettyBytes(100);
//=> '100 B'
MIT © Sindre Sorhus