🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

any-ipv4

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

any-ipv4

The easiest way to show an IPv4 address

0.1.1
latest
Source
npm
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
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

IP

FAQs

Package last updated on 13 Oct 2021

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