pretty-size
v2.0.0
Published
Display human readable file size .
Downloads
411
Readme
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 .