New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

get-os-ip

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-os-ip

Get local IPv4 or IPv6 address

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

get-os-ip.js

Get local IPv4 or IPv6 address

⚙️ Installation

npm i get-os-ip

CDN Links:

  • https://cdn.jsdelivr.net/npm/get-os-ip@1.0.0/get-os-ip.js
  • https://www.unpkg.com/get-os-ip@1.0.0/get-os-ip.js

📖 Usage

● Import

// ES6
import getOsIp from "get-os-ip";

// commonjs
const getOsIp = require("get-os-ip");

● Local IPv6

const ipv6 = getOsIp();           // ⌝
                                  //  | "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
const alsoIpv6 = getOsIp("v6");   // ⌟

console.log('Local IPv6: ' + ipv6);

● Local IPv4

const ipv4 = getOsIp("v4");       // 172.16.254.1

console.log('Local IPv4: ' + ipv4);

Support me on PatreonCheck out my socials

Keywords

get-local-ip

FAQs

Package last updated on 15 May 2023

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