New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ip-fetch

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ip-fetch

Package that helps you to find the exact location of an IP address

latest
Source
npmnpm
Version
2.0.0
Version published
Maintainers
1
Created
Source

ipLoc (ip-fetch)

ipLoc is a CLI tool and also an npm package to gather accurate information about an IP Address such as Country, City, CountryCode, Lattitude, Longitude, Internet Service Provider, etc. It is completely written in JavaScript ⌨️.

Installation 📥

  • git clone https://github.com/Prasobh-23/ipLoc.git

Setup ⚙️

  • cd ipLoc
  • npm i package.json

This command will install all the npm packages required to run ipLoc

Running CLI 🏃🏼‍♂️

  • ip-fetch

You just have to type 'ip-fetch' and hit enter

How to use

After you hit enter, a prompt will be displayed by asking for a valid IPv4 address. Then type in your IP address and hit enter again. It will fetch the information and display it shortly

using npx

You just have to type 'npx ip-fetch <ip address> and hit enter

npm Package

Installation 📥

  • npm i ip-fetch

Setup ⚙️

const ipfetch = require('ip-fetch');

let info;

let fun = async () =>{
    info = await ipfetch.getLocationNpm('ip address'); // example => info = await ipfetch.getLocationNpm('1.1.1.1');
    console.log(info);
}
fun();
//Then you will get a json object as response. If you need each element as indivual values , then you can do

console.log(info.country) // this will only print the country name

name of each elements in the JSON file

status, country, countryCode, region, regionName, city, zip, lat, lon, timezone, isp, org.

Keywords

ip-fetch

FAQs

Package last updated on 15 Nov 2023

Did you know?

Socket

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.

Install

Related posts