Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

bep53-range

webtorrent53.4kMIT2.0.0TypeScript support: included

Magnet URI extension (BEP53) range implementation

bittorrent, magnet, p2p, uri, bep53, range, webtorrent

readme

bep53-range ci npm downloads javascript style guide

Parse and compose Magnet URI extension (BEP53) ranges.

Also works in the browser with browserify! This module is used by WebTorrent.

install

npm install bep53-range

usage

parse

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

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.

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 and WebTorrent, LLC.

changelog

2.0.0 (2022-11-16)

chore

BREAKING CHANGES

  • ESM only
  • refactor: esm module update

  • use export and import with destructuring

  • define default exports
  • update tests Signed-off-by: Lakshya Singh lakshay.singh1108@gmail.com

  • chore: update package.json and readme

  • use destruct in readme Signed-off-by: Lakshya Singh lakshay.singh1108@gmail.com

  • chore: update deps security issue

Signed-off-by: Lakshya Singh lakshay.singh1108@gmail.com

  • Update package.json

Signed-off-by: Lakshya Singh lakshay.singh1108@gmail.com Co-authored-by: Diego Rodríguez Baquero github@diegorbaquero.com

  • ESM only

1.1.1 (2021-07-23)

Bug Fixes

  • add semantic release, switch CI (211c24b)