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 🙏

© 2024 – Pkg Stats / Ryan Hefner

geo-ipify

v1.0.9

Published

> Easily get your public IP address, network details, and internet service provider info.

Downloads

30

Readme

Geo Ipify

Easily get your public IP address, network details, and internet service provider info.

See live example usage here

Using the Geo Ipify

This is built on Ipify API, to get user's IP address & you can also get more information from the IP address by passing an APIKEY gotten from get ipify website.

To get IP address with all it's network information, retrieve a free API key from here https://geo.ipify.org/

Install

npm install geo-ipify or yarn add geo-ipify

Usage

Use the getIpAddressOnly() to get only user's IP address. You DO NOT need to add an API key

Use the getIpAddressAndNetworkInfo(apiKey: string, ipAddress?: string) To get more network information from an IP address. You need to add an API key. For this example you can add an optional ipAddress parameter if the IP you want to check is a specific IP address.

Example

import { getIpAddressOnly, getIpAddressAndNetworkInfo } from 'geo-ipify';

// IP address only
const result = await getIpAddressOnly();
// You can explicitly pass in an optional ipAddress parameter as well if you want to.
// getIpAddressOnly('187.201.32.8');

console.log(result.data);
//=> { "ip": "187.201.32.8" }


// IP address with all network information
const result = await getIpAddressAndNetworkInfo('apikey', '8.8.8.8');
// The IP address parameter is optional
// getIpAddressAndNetworkInfo('apikey');

console.log(result.data);
//=> {
//     "ip": "8.8.8.8",
//     "location": {
//         "country": "US",
//         "region": "California",
//         "timezone": "-07:00",
//     },
//     "domains": [
//         "0d2.net",
//         "003725.com",
//         "0f6.b0094c.cn",
//         "007515.com",
//         "0guhi.jocose.cn"
//     ],
//     "as": {
//         "asn": 15169,
//         "name": "Google LLC",
//         "route": "8.8.8.0/24",
//         "domain": "https://about.google/intl/en/",
//         "type": "Content"
//     },
//     "isp": "Google LLC"
// }

See live example usage here

API

getIpAddressOnly()

Returns a Promise<object> with an object containing your ip address only. You can explicitly pass in an optional ipAddress parameter as well if you want to.

getIpAddressAndNetworkInfo(apiKey)

Returns a Promise<object> with an object containing your ip address and other network and device information, for this you need to add an API key. You can add an optional ipAddress parameter if the IP you want to check is a specific IP address.