byte-human
Version:
Convert byte size to human-readable size
67 lines (38 loc) • 995 B
Markdown
byte size to human-readable size
```sh
$ npm install byte-human
```
```js
import byteHuman from 'byte-human';
byteHuman(2324606976); // => 2.32 GB
```
Return: `string`
Convert byte size to human-readable size.
Type: `number`
Type: `Object`
Options you can configure.
Type: `string | undefined`
Separator between number and unit, default is space.
```js
import byteHuman from 'byte-human';
byteHuman(2324606976); // => 2.32 GB
byteHuman(2324606976, { separator: "_" }); // => 2.32_GB
```
Type: `number | undefined`
For `Number
```js
import byteHuman from 'byte-human';
byteHuman(2324606976); // => 2.32 GB
byteHuman(2324606976, { fixed: 1 }); // => 2.3 GB
```
Copyright © 2025-Present [Hyper-Z11](https://github.com/hyperz111/). Licensed under [ISC License](https://www.isc.org/licenses/).
Convert