node-human-size

tiny node.js module to get human readable file size from byte count

MIT License

Downloads
24.2K
Stars
7
Committers
1

node-human-size

Tiny module to get a human readable file size from a byte count.

Usage

var humanSize = require('human-size');

console.log(humanSize(10 * 1024 * 1024));
// prints "10MB"

console.log(humanSize(10 * 1024 * 1024, 2));
// prints "10.00MB"

console.log(humanSize(106168));
// prints "103KB"

console.log(humanSize(106168, 2));
// prints "103.68KB"