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

geodata-kit-subdivisions

v0.4.1

Published

States, provinces, cantons and the levels below them for every country, with ISO 3166-2 codes, local names and free-text resolution. Offline add-on for geodata-kit.

Readme

geodata-kit-subdivisions

States, provinces, cantons and Länder of every country, and the levels below them, with ISO 3166-2 codes, local names and free-text resolution. Offline and typed.

npm install geodata-kit-subdivisions

geodata-kit (countries) is installed with it.

import { resolveSubdivision, listSubdivisions, findSubdivision, getSubdivisionChain } from 'geodata-kit-subdivisions';

resolveSubdivision('Bayern', 'DE')?.iso;   // 'DE-BY'
listSubdivisions('CH').length;             // 26
await findSubdivision('Oberbayern', 'DE'); // a level-2 region
await getSubdivisionChain({ country: 'DE', subdivision1: '02', subdivision2: '091', subdivision3: '09184', subdivision4: '09184148' });
// Bavaria → Upper Bavaria → Landkreis München → Unterhaching

API

Level 1 = states, provinces, cantons, Länder (loaded with the package). Levels 2–4 are the divisions below; each country's data loads on first use, so those functions are async.

| Function | Returns | |---|---| | listSubdivisions(code) | level-1 subdivisions of a country | | getSubdivision(isoOrKey) | by ISO 3166-2 code ('DE-BY') or internal key ('DE.02') | | resolveSubdivision(text, code?) | from a name, local name, abbreviation or ISO code | | isSubdivisionCode(value) | true for a valid ISO 3166-2 code | | getSubdivisionName(iso) | English name of any ISO 3166-2 code | | loadSubdivisions(code, { level?, parent? }) | async; any level, optionally under a parent | | findSubdivision(text, code, { level? }) | async; by name on any level | | getSubdivisionChain(place) | async; level 1 down to 4 for a city or other place |

The geodata-kit family

Install only the parts you need. All packages work offline and are released together under one version number: keep the ones you install on the same version.

| Package | For | Size | |---|---|---| | geodata-kit | countries, names, search, groups (EU, DACH, …), languages, timezones, currencies | 2 MB | | geodata-kit-subdivisions (this one) | states, provinces, cantons and the levels below | 27 MB | | geodata-kit-cities | 237,000 cities, free-text locations, city timezones | 36 MB | | geodata-kit-airports | airports by IATA / ICAO code | 1 MB | | geodata-kit-shapes | which country or region a coordinate is in | 10 MB | | geodata-kit-address | address formats, required fields, postal-code rules | 0.6 MB | | geodata-kit-phone | parse, validate and format phone numbers | 0.6 MB | | geodata-kit-localities | 4.9 million villages and city districts (used by geodata-kit-cities) | 83 MB | | geodata-kit-postal | postal code → place lookups | 19 MB | | geodata-kit-tz | exact timezone for any coordinate | 7.5 MB |

Data

The data is refreshed about once a month, and each release says so in its changelog. DATA_DATE tells you how fresh the installed version is.

| Constant | Value | |---|---| | DATA_DATE | date of the data in this version, for example '2026-11-12' |

License

Code: MIT. Data: CC BY 4.0 and Unicode License v3. CC BY 4.0 asks for credit: if you show or redistribute the data, include the credits from NOTICE.