# pretty-byte

> Convert bytes to a human readable string: 1337 → 1.31 kB

Latest version **1.0.1** (published 2016-01-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install pretty-byte
pnpm add pretty-byte
yarn add pretty-byte
bun add pretty-byte
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-01-12 |
| First published | 2016-01-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | LonelyClick |
| Maintainers | lonelyclick |
| Keywords | pretty, bytes, byte, filesize, size, file, human, humanized, readable, si, data |

## Links

- npm: https://www.npmjs.com/package/pretty-byte
- Repository: https://github.com/lonelyclick/pretty-byte
- Homepage: https://github.com/lonelyclick/pretty-byte#readme
- Issues: https://github.com/lonelyclick/pretty-byte/issues
- npm.io page: https://npm.io/package/pretty-byte

## Dependencies (1)

- [number-is-nan](https://npm.io/package/number-is-nan.md) ^1.0.0

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-01-12
- 1.0.0 — 2016-01-12

## README

# Fork by [pretty-bytes](https://github.com/sindresorhus/pretty-bytes) diff 1024

> Convert bytes to a human readable string: `1337` → `1.31 kB`

Useful for displaying file sizes for humans.

*Note that it uses base-1024 (eg. kibibyte).  
[Read about the difference between kilobyte and kibibyte.](http://pacoup.com/2009/05/26/kb-kb-kib-whats-up-with-that/)*


## Install

```
$ npm install --save pretty-byte
```


## Usage

```js
const prettyByte = require('pretty-byte');

prettyByte(1337);
//=> '1.31 kB'

prettyByte(100);
//=> '100 B'
```

## License

MIT

---
_Source: https://npm.io/package/pretty-byte · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
