bytes-human-readable
v1.0.2
Published
Bytes to human readable size
Downloads
5
Readme
bytes-human-readable
Get the byte length of an ArrayBuffer, even in engines without a .byteLength
method.
Example
const humanFileSize = require('bytes-human-readable');
console.log(humanFileSize(67229)); //67.2 KB
console.log(humanFileSize(67229, true, 2)); //67.23 KB
console.log(humanFileSize(67229, false)); //65.7 KiB
Tests
Simply clone the repo, npm install
, and run npm test