# bep53-range

> Magnet URI extension (BEP53) range implementation

Latest version **2.0.1** (published 2026-05-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install bep53-range
pnpm add bep53-range
yarn add bep53-range
bun add bep53-range
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-05-25 |
| First published | 2020-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=12.20.0 |
| Dependencies | 0 |
| Unpacked size | 5.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11 |
| Author | Julen Garcia Leunda |
| Maintainers | feross, mafintosh, flet, watson, diegorbaquero, hicom150, jhiesey, webtorrent-bot, alxhotel |
| Keywords | bittorrent, magnet, p2p, uri, bep53, range, webtorrent |

## Links

- npm: https://www.npmjs.com/package/bep53-range
- Repository: https://github.com/webtorrent/bep53-range
- Homepage: https://github.com/webtorrent/bep53-range#readme
- Issues: https://github.com/webtorrent/bep53-range/issues
- npm.io page: https://npm.io/package/bep53-range

## Recent versions

- 2.0.1 (latest) — 2026-05-25
- 2.0.0 — 2022-11-16
- 1.1.1 — 2021-07-23
- 1.1.0 — 2020-11-26
- 1.0.0 — 2020-10-18

## README

# bep53-range [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]

[ci-image]: https://github.com/webtorrent/bep53-range/actions/workflows/ci.yml/badge.svg
[ci-url]: https://github.com/webtorrent/bep53-range/actions/workflows/ci.yml
[npm-image]: https://img.shields.io/npm/v/bep53-range.svg
[npm-url]: https://npmjs.org/package/bep53-range
[downloads-image]: https://img.shields.io/npm/dm/bep53-range.svg
[downloads-url]: https://npmjs.org/package/bep53-range
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com

### Parse and compose Magnet URI extension (BEP53) ranges.

Also works in the browser with [browserify](http://browserify.org/)! This module is used by [WebTorrent](http://webtorrent.io).

## install

```
npm install bep53-range
```

## usage

### parse

Parse Magnet URI extension (BEP53) range and return all included values.

```js
import { parse } from 'bep53-range'

const range = ['1-3', '6', '11-13']

const values = parse(range)
console.log(values) // [1, 2, 3, 6, 11, 12, 13]

```

### compose

Compose Magnet URI extension (BEP53) range from all included values.

```js
import { compose } from 'bep53-range'

const values = [1, 2, 3, 6, 11, 12, 13]

const range = compose(values)
console.log(range) // ['1-3', '6', '11-13']
```

## license

MIT. Copyright (c) [Julen Garcia Leunda](https://github.com/hicom150) and [WebTorrent, LLC](https://webtorrent.io).

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