internal-ip
- Version 8.0.0
- Published
- 7.35 kB
- 4 dependencies
- MIT license
Install
npm i internal-ip
yarn add internal-ip
pnpm add internal-ip
Overview
Get your internal IP address
Index
Functions
function internalIpV4
internalIpV4: () => Promise<string | undefined>;
Returns
The IPv4 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.Example 1
import {internalIpV4} from 'internal-ip';console.log(await internalIpV4());//=> '10.0.0.79'
function internalIpV4Sync
internalIpV4Sync: () => string | undefined;
Returns
The IPv4 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.Example 1
import {internalIpV4Sync} from 'internal-ip';console.log(internalIpV4Sync());//=> '10.0.0.79'
function internalIpV6
internalIpV6: () => Promise<string | undefined>;
Returns
The IPv6 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.Example 1
import {internalIpV6} from 'internal-ip';console.log(await internalIpV6());//=> 'fe80::1'
function internalIpV6Sync
internalIpV6Sync: () => string | undefined;
Returns
The IPv6 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.Example 1
import {internalIpV6Sync} from 'internal-ip';console.log(internalIpV6Sync());//=> 'fe80::1'
Package Files (1)
Dependencies (4)
Dev Dependencies (3)
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/internal-ip
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/internal-ip)
- HTML<a href="https://www.jsdocs.io/package/internal-ip"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 1263 ms. - Missing or incorrect documentation? Open an issue for this package.