JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 222169
  • Score
    100M100P100Q163674F

Convert bytes to other sizes for prettier logging

Package Exports

  • prettysize

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 (prettysize) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

PrettySize

Helper utility to provide pretty printed file sizes (best used for logging or CLI output)

Build Status

Build Status

Usage

npm install prettysize
var pretty = require('prettysize');

var str = pretty(1024);
//str = "1 kB"

var str = pretty(1024 * 1024);
//str = "1 MB"

var str = pretty(123456789);
//str = "117.7 MB"

It supports the following sizes:

  • bytes
  • Kb
  • MB
  • GB
  • TB
  • PB
  • EB