Skip to content

andrewrk/node-human-size

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published