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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@fonderie/geo

v0.2.13

Published

Self-hosted IP → location. Provider-abstracted (IGeoProvider); the default resolves against a Postgres table of MaxMind/Hurricane-Electric CIDR blocks using native inet/GiST — IPv4 and IPv6, no external API, no key shipped. A signal source for @fonderie/r

Readme

@fonderie/geo

Self-hosted IP → location. Resolve an IPv4/IPv6 address to a country / region / city / lat-lng against a Postgres table loaded from MaxMind GeoLite2 (or Hurricane Electric) CSVs — no external API, no key shipped.

Status: experimental (0.x).

Provider-abstracted via IGeoProvider — the default PostgresGeoProvider is self-hosted; a consumer who prefers a hosted source (MaxMind API, ipinfo, …) plugs one in behind the same interface, the way billing swaps payment providers. You're never locked into the self-hosted map.

Why it's a brick

It's a signal source, not a product: @fonderie/risk consumes it (geo / impossible-travel), and any Fonderie app gets a day-one "where did this request come from" — access-log geo, suspicious-login hints — for free. In-process, against your own database.

Use it

import { PostgresGeoProvider, loadMaxMindCity } from '@fonderie/geo';
import { getMigrationsPath } from '@fonderie/geo/migrations';
// 1. run getMigrationsPath()'s SQL with your store's migration runner
// 2. one-time load (full snapshot; re-run to refresh):
await loadMaxMindCity(store, {
  locationsPath: 'GeoLite2-City-Locations-en.csv',
  blocksV4Path:  'GeoLite2-City-Blocks-IPv4.csv',
  blocksV6Path:  'GeoLite2-City-Blocks-IPv6.csv',
});

const geo = new PostgresGeoProvider(store);
const loc = await geo.lookup(ip); // → { country, subdivision, city, latitude, longitude, … } | null

How the lookup works

Blocks are stored as native cidr, so one table holds IPv4 and IPv6. A lookup is a CIDR containment — WHERE network >>= $ip::inet ORDER BY masklen(network) DESC LIMIT 1 — the most-specific block that contains the address wins. A GiST inet_ops index (core Postgres, no extension) makes it fast. Invalid input resolves to null, never an error.

Data

The CSVs are MaxMind's (GeoLite2 City, free with an account) or a compatible source — you download and host them; nothing proprietary ships in this package. loadMaxMindCity truncates and reloads (the dataset is a full snapshot).

Peer-depends on @fonderie/core + @fonderie/store; imports no other brick.