JSPM

human-size

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5109
  • Score
    100M100P100Q123123F
  • License MIT

human readable file size

Package Exports

  • human-size

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (human-size) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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"