npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ip-insight

v0.0.2

Published

A utility to fetch IP details including country, timezone, and geo location.

Downloads

8

Readme

ip-insight

ip-insight is a utility for fetching IP geo-location details, including country, city, timezone, currency, and more.

Installation

npm install ip-insight

Usage

Input: Request Object (req)

The ip-insight utility expects a Node.js req object (commonly available in frameworks like Express.js). It uses the x-forwarded-for header or the remoteAddress property to determine the client IP address.

The req object should have the following structure:

  1. req.headers: Contains the x-forwarded-for header, which may include the client's IP address (especially useful behind proxies or load balancers).
  2. req.socket: Contains the remoteAddress property, which is the IP address of the direct connection.

How to Use

Here’s an example of how to use ip-insight:

const getIpDetails = require("ip-insight");

// Example Express.js route
app.get("/api/ip-details", (req, res) => {
  const details = getIpDetails(req);
  res.json(details);
});

Response Format

"ip": "2405:201:2024:a801:c19a:3cfc:8f08:1df5",
"is_eu": "0",
"city": "Surat",
"region": "GJ",
"region_code": "GJ",
"region_type": "",
"country_code": "IN",
"country_name": "India",
"capital": "New Delhi",
"currency": "INR",
"iso": "IND",
"latitude": 21.1888,
"longitude": 72.8293,
"timezone": "Asia/Kolkata",
"currentTime": "17:59:33"

Features

  • IP Geolocation: Identify the country, city, and region of an IP address.
  • Country Details: Includes country name, capital, currency, and ISO codes.
  • Timezone Detection: Fetches the timezone and calculates the current time in the specified timezone.
  • EU Status: Determines whether the IP belongs to the European Union.
  • Customizable Data: Easily extend or modify the country-specific JSON files for additional details.
  • Supports IPv4 and IPv6: Works seamlessly with both IPv4 and IPv6 addresses

Notes

  • The package uses the geoip-lite library for IP geolocation. Ensure your application environment allows real IP addresses for accurate results.
  • For local testing (localhost or 127.0.0.1), the package replaces the IP with a public IP example.

Contributing

Feel free to fork the repository, make changes, and open a pull request. Contributions are welcome!