Gathering detailed insights and metrics for non-private-ip
Gathering detailed insights and metrics for non-private-ip
Gathering detailed insights and metrics for non-private-ip
Gathering detailed insights and metrics for non-private-ip
npm install non-private-ip
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
4 Stars
43 Commits
2 Forks
2 Watchers
3 Branches
9 Contributors
Updated on Jan 24, 2022
Latest Version
2.2.0
Package Id
non-private-ip@2.2.0
Unpacked Size
9.89 kB
Size
3.47 kB
File Count
8
NPM Version
6.14.8
Node Version
12.19.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
Picks the first reasonable looking IP address from network interfaces.
This should just work when running on a VPS, but also provides private
APIs
so that when running in LAN you get the first reasonable looking LAN IP address.
More info: http://en.wikipedia.org/wiki/Private_network
Your laptop probably does not have a non-local IP address, but your VPS server probably does. This just returns the first address, which will probably be IPv4.
This module is based on the "ip" module.
The main export is a function nonPrivateIP(interfaces, filter, details)
where:
interfaces
is either null
or a mock of os.networkInterfaces()
, typically
this should be null
filter
is a function of the shape (address, details) => boolean
where
address
is the IP address as a string, and details
is the whole object
with additional fields, e.g. address
, netmask
, family
, mac
, cidr
,
etcdetails
is a boolean that controls whether you want the return of the
function to be just the IP address as a string (false
, this is the
default) or the whole object with additional fields (true
)1// On a VPS: 2const nonPrivateIP = require('non-private-ip') 3nonPrivateIP() // 80.78.25.153
1// In a LAN: 2const nonPrivateIP = require('non-private-ip') 3nonPrivateIP.private() // 192.168.0.101
MIT
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
6 existing vulnerabilities detected
Details
Reason
Found 8/22 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-07-07
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More