iso-3166-ts
TypeScript icon, indicating that this package has built-in type declarations

2.2.0 • Public • Published

ISO 3166 Typescript types

Typescript data type for ISO3166-alpha2 country codes, as well as mappings for country code => country name

Examples

import { getIso3166CountryName, isIso3166Alpha2Code, Iso3166Alpha2Code, ISO_3166_ALPHA_2 } from "iso-3166-ts";

const countryCode:Iso3166Alpha2Code = "NL";

isIso3166Alpha2Code("NL"); // true
isIso3166Alpha2Code("ZZ"); // false

getIso3166CountryName(countryCode); // 'Netherlands'

/** Array containing all ISO3166 Alpha 2 country codes */
const allCountryCodes:Iso3166Alpha2Code[] = ISO_3166_ALPHA_2;

Dependents (0)

Package Sidebar

Install

npm i iso-3166-ts

Weekly Downloads

2,414

Version

2.2.0

License

ISC

Unpacked Size

31.4 kB

Total Files

6

Last publish

Collaborators

  • karpour