
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
GIP is a Node.js dependency-free tool for getting Public IPv4 address using "IP echo" services. It will fetch data from multiple services at the same time to give you results as fast as possible.
By default, GIP checks if an IP address is real by waiting for three same responses from different services. You can change this number by
adjusting the ensure
option.
GIP offers over 20 services, and you can also add your own services using the services
option. However, be aware that some services might
not always be available or may not work properly. That's why it's a good idea to keep the ensure
count at a reasonable level.
Below you can find some examples of how to use these options.
NodeJS version 20.0.0 or higher.
npm i gip
bun add gip
deno add npm:gip
pnpm add gip
import gip from "gip";
try {
const ip = await gip();
console.log(ip);
} catch (error) {
console.log(`Can't get your IP. Reason: ${error}`);
}
Usage with options
import gip from "gip";
const options = {
services: ["ipv4.icanhazip.com", "ifconfig.me/ip"],
ensure: 10,
};
try {
const ip = await gip(options);
console.log(ip);
} catch (error) {
console.log(`Can't get your IP. Reason: ${error}`);
}
npm i -g gip
bun i -g gip
deno i -g npm:gip
pnpm add -g gip
gip
# 133.74.20.69
Passing custom services
gip --services "https://ipv4.icanhazip.com/" "https://ifconfig.me/ip"
# 133.74.20.69
Setting ensure option
gip --ensure 10
# 133.74.20.69
npx gip
bunx gip
deno run --allow-net npm:gip
pnpm dlx gip
FAQs
Get your public IPv4 address
The npm package gip receives a total of 21 weekly downloads. As such, gip popularity was classified as not popular.
We found that gip demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.