package
Convert an 'address:port' string to an array [address:string, port:number]
npm install addr-to-ip-portGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 1 packages.
5.8 kB
Includes dependencies.
Uses a cache to prevent excessive array allocations and GC.
Works in node and the browser. This module is used by WebTorrent!
npm install addr-to-ip-portimport 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)MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.
feross
feross@feross.org