🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

addr-to-ip-port

Package Overview
Dependencies
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

addr-to-ip-port

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

2.0.0
latest
Source
npm
Version published
Weekly downloads
9.9K
9.05%
Maintainers
9
Weekly downloads
 
Created
Source

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.

Keywords

convert

FAQs

Package last updated on 16 Nov 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts