human-size
human readable file size
Last updated 5 years ago by superjoe .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install human-size 
SYNC missed versions from official npm registry.

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 "10 MB"

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

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

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

Current Tags

  • 1.1.0                                ...           latest (5 years ago)

2 Versions

  • 1.1.0                                ...           5 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2016 © taobao.org |