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

@lacspace/country

v1.0.0

Published

ISO 3166-1 countries with alpha-2/alpha-3/numeric codes, names, calling codes, currencies, top-level domains, regions and flag emoji — lookup by any code or name, search, and typed data. Zero-dependency, isomorphic.

Readme

@lacspace/country

Every country, by any name. ISO 3166-1 alpha-2, alpha-3 and numeric codes, English names, calling codes, currencies, top-level domains, continents and flag emoji for all 249 assigned codes. Look up by code, name or everyday alias. Zero dependencies, isomorphic, fully typed.

npm i @lacspace/country
import { country, countries, countriesUsing, searchCountries, flagEmoji } from "@lacspace/country";

country("np");           // { alpha2: "NP", alpha3: "NPL", numeric: "524", name: "Nepal", callingCodes: ["977"], currencies: ["NPR"], tld: ".np", region: "Asia", flag: "🇳🇵" }
country("Nepal");        // same
country(524);            // same
country("UK");           // United Kingdom — aliases like UK, USA, Holland, South Korea, Côte d'Ivoire in any spelling
countriesUsing("EUR");   // 35 countries
searchCountries("uni");  // United Arab Emirates, United Kingdom, United States … ranked
flagEmoji("in");         // "🇮🇳"

API

| Function | Returns | |---|---| | country(codeOrName) | The country for an alpha-2, alpha-3, numeric code, English name, ICU name or alias, or undefined | | countries() | All 249, sorted by alpha-2 | | isCountryCode(x) | Type guard for an assigned alpha-2 | | countryName(code) · alpha2ToAlpha3 · alpha3ToAlpha2 · numericToAlpha2 | Code conversions | | callingCode("IN") → "91" · countriesByCallingCode("+44") → GB, GG, IM, JE · callingCodes() | ITU E.164 | | countriesUsing("INR") → IN, BT · countriesInRegion("Asia") | Groupings | | searchCountries("guin", 10) | Ranked partial matches (prefix > word prefix > substring), aliases included | | flagEmoji("NP") · normalizeName(s) | Helpers |

Names are the ISO English short names ("Korea, Republic of"); lookups also accept the natural order ("Republic of Korea"), ICU's names ("South Korea", "St. Kitts & Nevis") and common aliases.

How it was checked

The table is verified in the test suite against the ICU data built into Node: every alpha-2 is a region ICU knows, and ICU's English name for each of the 249 regions resolves back to the same country. Every currency is an ISO 4217 code, every code column is unique, and the continent totals add up to 249.

The Lacspace Developer Platform

This package is part of the Lacspace developer platform: 150+ zero-dependency packages, one CLI, real docs. Browse the Global Data Kit or every package at developer.lacspace.com/packages.

Licence

Free under the Lacspace Free Licence v1.0.