vlad 6f123ff03e 18.07 6 anni fa
..
index.js 6f123ff03e 18.07 6 anni fa
license 6f123ff03e 18.07 6 anni fa
package.json 6f123ff03e 18.07 6 anni fa
readme.md 6f123ff03e 18.07 6 anni fa

readme.md

pretty-bytes Build Status

Convert bytes to a human readable string: 13371.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 = require('pretty-bytes');

prettyBytes(1337);
//=> '1.34 kB'

prettyBytes(100);
//=> '100 B'

Related

License

MIT © Sindre Sorhus