Socket
Socket
Sign inDemoInstall

any-ipv4

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    any-ipv4

The easiest way to show an IPv4 address


Version published
Weekly downloads
16
decreased by-30.43%
Maintainers
1
Install size
3.29 kB
Created
Weekly downloads
 

Readme

Source

any-ipv4

A module that exports an Array of IPv4, non internal, addresses, wuth a handy toString() method that returns its first IP, or 0.0.0.0 if no IPv4 was found.

The list of IPs is Wi-Fi first, Ethernet after, which is the most common use case I have for IoT projects and so on.

import IPv4 from 'any-ipv4';
import {createServer} from 'http';

createServer(handler).listen(8080, () => {
  console.log(`http://${IPv4}:8080/`);
});

Keywords

FAQs

Last updated on 13 Oct 2021

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc