https://github.com/npx-bin/myip
🌏 MyIP - A Utility to fetch IP Addresses
https://github.com/npx-bin/myip
ip ipaddr ipaddress myip
Last synced: about 2 months ago
JSON representation
🌏 MyIP - A Utility to fetch IP Addresses
- Host: GitHub
- URL: https://github.com/npx-bin/myip
- Owner: npx-bin
- License: mit
- Created: 2019-12-12T05:20:28.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2026-04-13T01:21:56.000Z (about 2 months ago)
- Last Synced: 2026-04-13T03:20:19.256Z (about 2 months ago)
- Topics: ip, ipaddr, ipaddress, myip
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/@kcak11/myip
- Size: 91.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# MyIP - A Utility to fetch IP Addresses
## Installation:
```
$ npm i -g @kcak11/myip
```
### Usage as Command Line Interface (CLI):
```
$ myip
```
The above will output the current IP addresses associated with your machine as below:
```
Following are the IP Addresses for your machine:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| IP Address | Usage in a web-browser |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| xyz.pqr.a.b | http://xyz.pqr.a.b |
| xyz.pq.abc.def | http://xyz.pq.abc.def |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
External(public) IP: XXX.YY.ZZ.AAA
```
## Usage in Node Scripts
```
const myip=require("@kcak11/myip");
let listOfIP = myip(); // listOfIP will be an array containing the IP addresses.
console.log(listOfIP);
let externalIP = require("@kcak11/myip/external");
externalIP().then((data) => {
console.log("External IP: " + data.myip);
console.log("Country: " + data.country);
});
```
Output:
```
["xyz.pqr.a.b","xyz.pq.abc.def"]
External IP: XXX.YY.ZZ.AAA
Country: CC
```
## License: [MIT License](https://mit-license.kcak11.com)
© 2023 [kcak11.com](https://www.kcak11.com "Ashish's Web")