public-ip alternatives and similar modules
Based on the "Command Line Apps" category.
Alternatively, view public-ip alternatives based on common mentions on social networks and blogs.
-
Standard
🌟 JavaScript Style Guide, with linter & automatic code fixer -
ignite
Infinite Red's battle-tested React Native project boilerplate, along with a CLI, component/model generators, and more! -
Live Server
A simple development http server with live reload capability. -
speed-test
Test your internet connection speed and ping using speedtest.net from the CLI -
rtail
rtail(1) - Terminal output to the browser in seconds, using UNIX pipes. -
David
:eyeglasses: Node.js module that tells you when your package npm dependencies are out of date. -
diff2html-cli
Pretty diff to html javascript cli (diff2html-cli) -
Whatspup
:white_square_button: WhatsApp chat from commandline/console/cli using GoogleChrome puppeteer -
pjs
Pipeable javascript. Quickly filter, map, and reduce from the terminal -
kill-tabs
Kill all Chrome tabs to improve performance, decrease battery usage, and save memory -
tty-table
Terminal table for Windows, Linux, and MacOS. Written in nodejs. Also works in browser console. Word wrap, padding, alignment, colors, Asian character support, per-column callbacks, and you can pass rows as objects or arrays. Backwards compatible with Automattic/cli-table. -
normit
Translations with speech synthesis in your terminal as a node package -
npm-name
Check whether a package or organization name is available on npm
Appwrite - The Open Source Firebase alternative introduces iOS support
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of public-ip or a related project?
README
public-ip
Get your public IP address - very fast!
In Node.js, it queries the DNS records of OpenDNS, Google DNS, and HTTPS services to determine your IP address. In browsers, it uses the excellent icanhaz and ipify services through HTTPS.
Install
npm install public-ip
Usage
import {publicIp, publicIpv4, publicIpv6} from 'public-ip';
console.log(await publicIp()); // Falls back to IPv4
//=> 'fe80::200:f8ff:fe21:67cf'
console.log(await publicIpv6());
//=> 'fe80::200:f8ff:fe21:67cf'
console.log(await publicIpv4());
//=> '46.5.21.123'
API
publicIp(options?)
Returns a Promise<string>
with your public IPv4 or IPv6 address. Rejects on error or timeout.
A .cancel()
method is available on the promise, which can be used to cancel the request.
publicIpv6(options?)
Returns a Promise<string>
with your public IPv6 address. Rejects on error or timeout.
A .cancel()
method is available on the promise, which can be used to cancel the request.
publicIpv4(options?)
Returns a Promise<string>
with your public IPv4 address. Rejects on error or timeout.
A .cancel()
method is available on the promise, which can be used to cancel the request.
options
Type: object
onlyHttps
Type: boolean
\
Default: false
Use a HTTPS check using the icanhazip.com service instead of the DNS query. ipify.org is used as a fallback if icanhazip.com
fails. This check is much more secure and tamper-proof, but also a lot slower. This option is only available in the Node.js version. The default behaviour is to check against DNS before using HTTPS fallback. If set to true
, it will only check against HTTPS.
fallbackUrls
Type: string[]
\
Default: []
Add your own custom HTTPS endpoints to get the public IP from. They will only be used if everything else fails. Any service used as fallback must return the IP as a plain string.
import {publicIpv6} from 'public-ip';
await publicIpv6({
fallbackUrls: [
'https://ifconfig.co/ip'
]
});
timeout
Type: number
\
Default: 5000
The time in milliseconds until a request is considered timed out.
IpNotFoundError
Error thrown when the public IP address could not be found.
CancelError
Error thrown when the operation was canceled.
Maintainers
Related
- public-ip-cli - CLI for this module
- internal-ip - Get your internal IP address