Security News
PyPI Introduces Digital Attestations to Strengthen Python Package Security
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
non-private-ip
Advanced tools
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
)// On a VPS:
const nonPrivateIP = require('non-private-ip')
nonPrivateIP() // 80.78.25.153
// In a LAN:
const nonPrivateIP = require('non-private-ip')
nonPrivateIP.private() // 192.168.0.101
MIT
FAQs
see if you have a non private (i.e. public ip address)
The npm package non-private-ip receives a total of 1,691 weekly downloads. As such, non-private-ip popularity was classified as popular.
We found that non-private-ip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.