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

ipmapjs

v1.0.2

Published

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

Downloads

2

Readme

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

|Command| Input | Description| Expected output| |---|---|---|---| |getGeolocation| A string ("123.6.225.1") or an array of strings (["123.6.225.1", "12.6.22.1"]) for a more efficient querying| It returns the geolocation of the provided IPs| If 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"| |isAnycast| A string ("123.6.225.1") or an array of strings (["123.6.225.1", "12.6.22.1"]) for a more efficient querying| It 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"| |getIXPs|None|Returns a list of IXPs| An array of IXPs from PeeringDB and other sources| |getIXP|The integer ID of an IXP|It returns information about an IXP|An object| |getFacilities|None| |An array of facilities from PeeringDB and other source| |getFacility|The integer ID of a facility| |An object| |getIXPsPeeringWithASN|The integer ASn| |An array of IXPs where ASN is peering| |getIXPFromIP| An IP address (string)| |If the IP belongs to a peering lan of an IXP, the related IXP object will be returned| |getIXPFromIPs|An array of IP addresses (strings)| |As above, but for multiple IPs. The output is a dictionary IP to IXP.| |getASNsPeeringWithIXP|An integer ID of an IXP| |An array of ASes peering with such an IXP| |getASNsHostedInFacility|An integer ID of a facility| |An array of ASes peering with such a facility| |getFacilitiesHostingASN|An integer ASn| |An array of facilities where the AS is peering|