Wondering what’s next for npm?Check out our public roadmap! »

    bep53-range
    TypeScript icon, indicating that this package has built-in type declarations

    1.1.0 • Public • Published

    bep53-range travis 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.

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

    compose

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

    const bep53Range = require('bep53-range')
     
    const values = [1, 2, 3, 6, 11, 12, 13]
     
    const range = bep53Range.compose(values)
    console.log(range) // ['1-3', '6', '11-13']

    license

    MIT. Copyright (c) Julen Garcia Leunda and WebTorrent, LLC.

    Install

    npm i bep53-range

    DownloadsWeekly Downloads

    13,037

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    4.22 kB

    Total Files

    5

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar