https://github.com/leecjson/node-parse-ip-port
Parse ip/hostname and port from a string that formed by "ip:port"
https://github.com/leecjson/node-parse-ip-port
Last synced: 11 months ago
JSON representation
Parse ip/hostname and port from a string that formed by "ip:port"
- Host: GitHub
- URL: https://github.com/leecjson/node-parse-ip-port
- Owner: leecjson
- Created: 2019-10-29T11:39:16.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T23:43:49.000Z (over 3 years ago)
- Last Synced: 2025-07-07T10:00:28.204Z (12 months ago)
- Language: JavaScript
- Homepage:
- Size: 231 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# node-ip-port
Parse ip and port from a string that formed by \"ip:port\"
# Usage
```javascript
const parseIpPort = require('parse-ip-port');
try {
const [ip, port] = parseIpPort('127.0.0.1:80');
} catch (e) {
console.log(e.toString());
}
```