Display human readable file size .


Keywords
es7, pretty-size, pretty, size
License
MIT
Install
npm install pretty-size@2.0.0

Documentation

Build Status Coverage Status

Overview :

Display human readable file size .

Install

npm install pretty-size --save;

Example :

const {prettySize} = require('pretty-size');
// import {prettySize} from 'pretty-size'; // ES6/ES7

prettySize(454434343)
  //'433.4 MiB'
prettySize(454434343,true)
  //'454.4 MB'
prettySize(134343,true)
  //'134.3 kB'
prettySize(1024*1024)
  //'1.0 MiB'
prettySize(1024*1024*1024*1024,true)
  //'1.1 TB'
prettySize(1024*1024*1024*1024,false)

License:

MIT .