Skip to content

tlouth19/human-readable-bytes

Repository files navigation

Human Readable Bytes

Convert bytes to a readable format (GB, MB, etc.)

Installation

  • npm install human-readable-bytes --save; or

  • yarn add human-readable-bytes.

Usage

import convertBytesToHumanReadable from 'human-readable-bytes'

convertBytesToHumanReadable(bytes, method, decimals, space)

Options

Param Description Valid Options
bytes The bytes to convert String/Integer
method File size calculation type 1000 or 1024
decimals Decimals to add to the file size Integer
space Add a space between file size and text (40GB vs. 40 GB) Boolean

About

Convert bytes to a readable format (GB, MB, etc.)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published