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

Package detail

addr-to-ip-port

webtorrent60.2kMIT2.0.0

Convert an 'address:port' string to an array [address:string, port:number]

convert, address, port, cache, string, array, ip, addr to ip port, webtorrent

readme

addr-to-ip-port ci npm downloads javascript style guide

Convert an "address:port" string to an array [address:string, port:number]

Uses a cache to prevent excessive array allocations and GC.

Works in node and the browser. This module is used by WebTorrent!

install

npm install addr-to-ip-port

usage

import addrToIPPort from 'addr-to-ip-port'

addrToIPPort('1.2.3.4:8000') //=> ['1.2.3.4', 8000]
addrToIPPort('1.2.3.4:8000') //=> ['1.2.3.4', 8000] (returns the cached object)

license

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

changelog

2.0.0 (2022-11-16)

chore

BREAKING CHANGES

  • ESM only

  • refactor: update to import/export syntax

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

  • chore: update package.json for modules and deps

  • define exports, nodejs version

  • update critical deps Signed-off-by: Lakshya Singh lakshay.singh1108@gmail.com

  • docs: update readme for using esm

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.5.4 (2021-07-30)

Performance Improvements

BREAKING CHANGES

  • reset function removed

  • perf: use Map

  • use clear

1.5.3 (2021-07-23)

Bug Fixes

1.5.2 (2021-07-23)

Bug Fixes

  • add semantic release, switch CI (7487964)