@brixtol/country-names
Country code (3166-1 alpha-2) to Country name (ISO 3166 mappings used by the Brixtol Textiles internal API when dealing with Localization and i18n operations.
Mappings returned in the English Language.
Minified: 4.04 KB
Gzipped: 2.18 KB
Install
pnpm
pnpm i @brixtol/country-names
Boomer / Sheep Alternatives
npm
npm install @brixtol/country-names
Yarn
yarn add @brixtol/country-names
Usage
You can pass in a 2 letter country code that is lowercase, uppercase or a mixture of both.
import { getCountryName } from "@brixtol/country-names";
const sweden = getCountryName("SE");
const netherlands = getCountryName("nl");
const usa = getCountryName("uS");
The module also exposes the raw mappings and interface on the export. The mappings object is provided read only using Object.freeze.
import { Countries, ICountries } from "@brixtol/country-names";
Countries.SE;
Countries.NL;
Countries.RU;
ICountries.SE;
ICountries.NL;
ICountries.RU;
The interface is identical to the mapping
Related
Country code to currency code mappings:
Currency code to currency symbol mappings:
License
Licensed under MIT
We ♡ open source!