addr-to-ip-port
![javascript style guide](https://camo.githubusercontent.com/bde227e3207c7143032c0feb73889ffbda8eb1ef234b820b915ccaf74f9c66d7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f64655f7374796c652d7374616e646172642d627269676874677265656e2e737667)
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
const addrToIPPort = require('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.