UNPKG

1.45 kBTypeScriptView Raw
1/**
2@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.
3
4@example
5```
6import {internalIpV6} from 'internal-ip';
7
8console.log(await internalIpV6());
9//=> 'fe80::1'
10```
11*/
12export function internalIpV6(): Promise<string | undefined>;
13
14/**
15@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.
16
17@example
18```
19import {internalIpV4} from 'internal-ip';
20
21console.log(await internalIpV4());
22//=> '10.0.0.79'
23```
24*/
25export function internalIpV4(): Promise<string | undefined>;
26
27/**
28@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.
29
30@example
31```
32import {internalIpV6Sync} from 'internal-ip';
33
34console.log(internalIpV6Sync());
35//=> 'fe80::1'
36```
37*/
38export function internalIpV6Sync(): string | undefined;
39
40/**
41@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.
42
43@example
44```
45import {internalIpV4Sync} from 'internal-ip';
46
47console.log(internalIpV4Sync());
48//=> '10.0.0.79'
49```
50*/
51export function internalIpV4Sync(): string | undefined;