Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ipmapjs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ipmapjs

IPmap.js is a utility for interacting with the RIPE IPmap service offered by RIPE NCC.

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

IPmap.js

IPmap.js is a utility for interacting with the RIPE IPmap service offered by RIPE NCC. With this library you can ask for the geolocation of an IP, verify if an IP is part of an IXP peering lan, and more. The library is developed in JS and can be used both on Node.js or in the browser.

Geolocation format

The geolocation format provided by RIPE IPmap is:

{
    "score": 126,
    "geofeed": "1.2.3.4,NL,NL-07,Amsterdam,",
    "countryCodeAlpha3": "NLD",
    "countryCodeAlpha2": "NL",
    "cityPopulation": 741636,
    "stateAnsiCode": "07",
    "pointGeometry": "0101000020E61000001E5036E50A8F134087DC0C37E02F4A40",
    "cityNameAscii": "Amsterdam",
    "stateIsoCode": "NL-07",
    "countryName": "Netherlands",
    "stateName": "North Holland",
    "longitude": 4.88969,
    "geonameId": 2759794,
    "latitude": 52.37403,
    "cityName": "Amsterdam",
    "type": "city",
    "id": "AMSTERDAM-NL-07-U173ZQ2SF4C47GPE4JPJ"
}

Quick Guide

CommandInputDescriptionExpected output
getGeolocationA string ("123.6.225.1") or an array of strings (["123.6.225.1", "12.6.22.1"]) for a more efficient queryingIt returns the geolocation of the provided IPsIf you provide a string, you will get the location. If you provide an array, you will get back a dictionary of <IP, location> pairs. If RIPE IPmap doesn't have a geolocation for a given IP, or if the IP is anycast, the output for that IP will be "null"
isAnycastA string ("123.6.225.1") or an array of strings (["123.6.225.1", "12.6.22.1"]) for a more efficient queryingIt returns a boolean (or null) for each of the provided IPs, each of which identifying if the IP is anycast or not.If you provide a string, you will get a single boolean. If you provide an array, you will get back a dictionary of <IP, boolean> pairs. If RIPE IPmap doesn't have an answer for a given IP, the value for that IP will be "null"
getIXPsNoneReturns a list of IXPsAn array of IXPs from PeeringDB and other sources
getIXPThe integer ID of an IXPIt returns information about an IXPAn object
getFacilitiesNoneAn array of facilities from PeeringDB and other source
getFacilityThe integer ID of a facilityAn object
getIXPsPeeringWithASNThe integer ASnAn array of IXPs where ASN is peering
getIXPFromIPAn IP address (string)If the IP belongs to a peering lan of an IXP, the related IXP object will be returned
getIXPFromIPsAn array of IP addresses (strings)As above, but for multiple IPs. The output is a dictionary IP to IXP.
getASNsPeeringWithIXPAn integer ID of an IXPAn array of ASes peering with such an IXP
getASNsHostedInFacilityAn integer ID of a facilityAn array of ASes peering with such a facility
getFacilitiesHostingASNAn integer ASnAn array of facilities where the AS is peering

Keywords

FAQs

Package last updated on 13 Sep 2021

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