# bytelabel

> convert byte lengths into a nice formatted string

Latest version **2.0.2** (published 2015-09-06) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install bytelabel
pnpm add bytelabel
yarn add bytelabel
bun add bytelabel
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.0.2 |
| Published | 2015-09-06 |
| First published | 2014-05-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Rory Bradford |
| Maintainers | roryrjb |
| Keywords | byte, size, stringify, parse |

## Links

- npm: https://www.npmjs.com/package/bytelabel
- Repository: https://github.com/roryrjb/bytelabel
- Issues: http://github.com/roryrjb/bytelabel/issues
- npm.io page: https://npm.io/package/bytelabel

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 2.0.2 (latest) — 2015-09-06
- 2.0.1 — 2015-09-06
- 2.0.0 — 2015-09-06
- 1.1.1 — 2015-06-21
- 1.1.0 — 2015-06-21
- 1.0.3 — 2014-12-07
- 1.0.2 — 2014-11-02
- 1.0.1 — 2014-05-04

## README

# bytelabel [![Build Status](https://travis-ci.org/roryrjb/bytelabel.svg?branch=master)](https://travis-ci.org/roryrjb/bytelabel) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)

> Convert byte lengths into a nice formatted string.

### Installation

```
$ npm install bytelabel
```

__Test:__

```
$ npm test
```

### Usage/API

__bytelabel(number)__

The only argument takes a number assumes that this value is in bytes and returns the size more nicely formatted.

__Examples:__

```javascript
var bytelabel = require('bytelabel')

// Parsed values

bytelabel(123)      // => '123 B'
bytelabel(4398)     // => '4.29 KB'
bytelabel(22323445) // => '21.28 MB'

// Rounding

bytelabel(123, {round: true})       // => '123 B'
bytelabel(4398, {round: true})      // => '4 KB'
bytelabel(22323445, {round: true})  // => '21 MB'

```

### License

MIT

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