Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 750 Bytes

README.md

File metadata and controls

35 lines (25 loc) · 750 Bytes

private-ip-address

Get your private IP address.

Installation

Install private-ip-address with your favorite package manager:

$ npm i private-ip-address -D
# or
$ yarn add private-ip-address -D
# or
$ pnpm i private-ip-address -D
# or
$ bun add private-ip-address -D

Usage

To use private-ip-address, import the internalIPv4 or internalIPv6 function:

// esm
import { internalIPv4, internalIPv6 } from 'private-ip-address';

// cjs
const { internalIPv4, internalIPv6 } = require('private-ip-address');

console.log(`Internal IPv4 address: ${internalIPv4()}`);
// Internal IPv4 address: 192.168.100.202

console.log(`Internal IPv6 address: ${internalIPv6()}`);
// Internal IPv6 address: fe80::ac97:42ff:fe19:cea