Public IP is a JavaScript package for quickly determining a device's externally visible IP address. It provides separate functions for IPv4, IPv6, or automatic detection that prefers IPv6 and falls back to IPv4. In Node.js, the package queries multiple DNS and HTTPS services to improve reliability. Browser environments use HTTPS-based public IP services instead of DNS queries. Operations are asynchronous and can be given explicit timeouts to avoid waiting indefinitely for unavailable services. AbortSignal support lets applications cancel an active lookup when it is no longer needed. A dedicated error type distinguishes cases where the package cannot determine a public address, making it useful for diagnostics, networking tools, and environment detection.

Features

  • Automatic public IP detection
  • Dedicated IPv4 and IPv6 lookup functions
  • Multiple DNS and HTTPS lookup providers
  • Node.js and browser support
  • Timeout and AbortSignal cancellation
  • Dedicated IP-not-found error handling

Project Samples

Project Activity

See All Activity >

Categories

Internet

License

MIT License

Follow public-ip

public-ip Web Site

Other Useful Business Software
Paessler - Monitor Your Whole Network in Minutes Icon
Paessler - Monitor Your Whole Network in Minutes

Auto-discovery finds your devices and deploys pre-configured sensors instantly. No project plan required, just visibility from day one.

Waiting weeks for a monitoring rollout isn't an option when infrastructure doesn't stop running. PRTG's auto-discovery scans your network and suggests from over 200 pre-configured sensor types, so you're watching servers, applications and devices within minutes, not after a multi-week deployment. Enterprise-strength monitoring, without the enterprise complexity. Start your free trial today.
Start Free 30-Day Trial
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of public-ip!

Additional Project Details

Programming Language

JavaScript

Related Categories

JavaScript Internet Software

Registered

2026-09-09