2.0.2 • Published 2 years ago

readable-bytes v2.0.2

Weekly downloads
7
License
MIT
Repository
github
Last release
2 years ago

readable-bytes

Build Status

A simple useful util to convert bytes to pretty string with proper or specified unit.

install

npm install readable-bytes --save

or with yarn

yarn add readable-bytes

usage

import readableBytes from 'readable-bytes'

// base 10
readableBytes(1000) // 1 KB
readableBytes(1000 * 1000) // 1 MB

parseBytes(1000 * 1000) // { value: 1, unit: 'MB' }

// base 2
readableBytes(1024, 2) // 1KiB
readableBytes(1024 * 1024, 2) // 1MiB
2.0.2

2 years ago

2.0.1

4 years ago

1.0.4

6 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago