internal-ip

WebJar for internal-ip

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

internal-ip
Last Version

Last Version

6.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

internal-ip
WebJar for internal-ip
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/internal-ip

Download internal-ip

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/internal-ip/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>internal-ip</artifactId>
    <version>6.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/internal-ip/
implementation 'org.webjars.npm:internal-ip:6.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/internal-ip/
implementation ("org.webjars.npm:internal-ip:6.2.0")
'org.webjars.npm:internal-ip:jar:6.2.0'
<dependency org="org.webjars.npm" name="internal-ip" rev="6.2.0">
  <artifact name="internal-ip" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='internal-ip', version='6.2.0')
)
libraryDependencies += "org.webjars.npm" % "internal-ip" % "6.2.0"
[org.webjars.npm/internal-ip "6.2.0"]

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : default-gateway jar [6.0.0,7)
org.webjars.npm : ipaddr.js jar [1.9.1,2)
org.webjars.npm » is-ip jar [3.1.0,4)
org.webjars.npm » p-event jar [4.2.0,5)

Project Modules

There are no modules declared in this project.

internal-ip Build Status

Get your internal IP address

Install

$ npm install internal-ip

Usage

const internalIp = require('internal-ip');

(async () => {
	console.log(await internalIp.v6());
	//=> 'fe80::1'

	console.log(await internalIp.v4());
	//=> '10.0.0.79'
})();

console.log(internalIp.v6.sync())
//=> 'fe80::1'

console.log(internalIp.v4.sync())
//=> '10.0.0.79'

The module returns the address of the internet-facing interface, as determined from the default gateway. When the address cannot be determined for any reason, undefined will be returned.

The module relies on operating systems tools. On Linux and Android, the ip command must be available, which depending on distribution might not be installed by default. It is usually provided by the iproute2 package. .v4.sync() and .v6.sync() are not supported in browsers and just return undefined.

Related


Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Versions

Version
6.2.0
4.3.0
4.2.0
1.2.0