Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

public-ip

Package Overview
Dependencies
Maintainers
2
Versions
34
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

public-ip

Get your public IP address - very fast!

  • 2.5.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created

What is public-ip?

The public-ip npm package allows you to get your public IP address (IPv4 or IPv6) from different services. It supports both IPv4 and IPv6, and it can be used in Node.js environments.

What are public-ip's main functionalities?

Get IPv4 Address

This feature allows you to get your public IPv4 address. The code sample demonstrates how to use the public-ip package to fetch and log the IPv4 address.

const publicIp = require('public-ip');
(async () => {
    console.log(await publicIp.v4());
})();

Get IPv6 Address

This feature allows you to get your public IPv6 address. The code sample demonstrates how to use the public-ip package to fetch and log the IPv6 address.

const publicIp = require('public-ip');
(async () => {
    console.log(await publicIp.v6());
})();

Get IP Address with Options

This feature allows you to get your public IP address with additional options. The code sample demonstrates how to use the public-ip package to fetch the IPv4 address using only HTTPS services.

const publicIp = require('public-ip');
(async () => {
    console.log(await publicIp.v4({ onlyHttps: true }));
})();

Other packages similar to public-ip

Keywords

FAQs

Package last updated on 14 Dec 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc