← All packages

@lacspace/country

v1.0.0Global Data Kit0 deps

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, name or alias, search, and typed data. Every code and ICU's name for it are cross-checked in the tests. Zero-dependency, isomorphic.

npm i @lacspace/country

Usage

country.ts
import { country, countriesUsing, flagEmoji } from "@lacspace/country";

country("Nepal");        // { alpha2: "NP", alpha3: "NPL", numeric: "524", callingCodes: ["977"], currencies: ["NPR"], … }
countriesUsing("EUR");   // 35 countries
flagEmoji("in");         // "🇮🇳"

Exports 15

countrycountriesisCountryCodecountryNamealpha2ToAlpha3alpha3ToAlpha2numericToAlpha2callingCodecountriesByCallingCodecallingCodescountriesUsingcountriesInRegionsearchCountriesflagEmojinormalizeName

Keywords

iso-3166country-codescountriescalling-codesflagsregionalpha-2alpha-3country-data

More in Global Data Kit

@lacspace/currency

ISO 4217 currencies — codes, numeric codes, minor units asserted against the ISO list (0 for JPY, 3 for BHD, 4 for CLF), names, symbols, fund/special classification and Intl-free formatting for en/de/fr/ch/in locales. Zero-dependency, isomorphic.

@lacspace/iban

Validate, parse and format IBANs (ISO 13616 registry for 90 countries, MOD 97-10) with bank/branch/account extraction, SEPA flag and generation, plus BIC/SWIFT (ISO 9362) and ISIN (ISO 6166) checks. Every registry example is verified by its own check digits. Zero-dependency, isomorphic.

@lacspace/tax-id

Validate tax and business identifiers with their real checksums — EU VAT (all 27 + UK/XI), Indian GSTIN and PAN, Australian ABN/ACN/TFN, NZ IRD, Canadian BN, US EIN, Brazilian CPF/CNPJ, Argentine CUIT, Chilean RUT, Mexican RFC, Nepali PAN, Singapore UEN, Korean BRN, Japanese corporate number and more — reporting checksum vs format strength. Zero-dependency, isomorphic.

@lacspace/phone

Parse, validate and format international phone numbers — E.164, national and international formats, country detection from the calling code (shared +1/+44/+7 codes resolved by leading digits), trunk prefixes, extensions, per-country length rules and mobile detection for 80+ countries. Isomorphic.

@lacspace/postal-code

Validate and normalise postal codes for 130 countries — ZIP, postcode, PIN, CEP — with the national spacing and casing (SW1A 1AA, K1A 0B1, 01310-100), and knows which countries have no postal codes. Zero-dependency, isomorphic.