New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

geoipasn

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

geoipasn

GeoIP query tool with AS number

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

GeoIPASN

GeoIP query tool with AS Number

GeoIP data from geoip-lite using MaxMind's GeoLite2 database

ASN data from APNIC (data-raw-table) (data-used-autnums)

Update GeoLite2 database to better results

cd node_modules/geoip-lite
npm run-script updatedb license_key=[KEY]

You can get free license key in MaxMind

Table of Content

Installation

npm i geoipasn

Usage

GeoIP Info

ESM

import geoip from 'geoipasn';

const data = geoip('12.34.56.78');
console.log(data);

CJS

const geoip = require('geoipasn').default;

const data = geoip('12.34.56.78');
console.log(data);
Result
{
  ip: IP { label: '12.34.56.78' },
  country: { code: 'US', name: 'United States of America' },
  region: 'Ohio',
  city: 'Dayton',
  coordinate: { latitude: 39.6438, longtitude: -84.1743, range: 5 },
  timezone: 'America/New_York',
  time: 2022-09-24T02:47:59.000Z,
  as: { number: 7018, name: 'ATT-INTERNET4' },
  service: ''
}

AS Number

// Get AS number of IP
const data = geoip.asn('12.34.56.78');
console.log(data);
Result
{ ip: IP { label: '12.34.56.78' }, number: 7018, name: 'ATT-INTERNET4' }

Keywords

FAQs

Package last updated on 25 Aug 2024

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc