1.1.0 • Published 6 years ago

human-readable-bytes v1.1.0

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

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

ParamDescriptionValid Options
bytesThe bytes to convertString/Integer
methodFile size calculation type1000 or 1024
decimalsDecimals to add to the file sizeInteger
spaceAdd a space between file size and text (40GB vs. 40 GB)Boolean
1.1.0

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago