Skip to content

Changelog

Package history for country-kit. Same text as packages/country-kit/CHANGELOG.md.

  • commonName, numeric, callingCodes, dialCode, region, subregion, independent, tld, capital, currencies, and nanpAreaCodes on Country
  • getCountry, getCountryByAlpha3, getCountryByNumeric, getCountryByTld, getDialCode, getCountryCommonName, getNumericCode, getCountryTld, getCountryCapital, getCountryCurrencies
  • getIndependentCountries, getCountrySelectOptions, getCountriesByCurrency, getCountriesBySubregion, listRegions, listSubregions, listCurrencies
  • getFlagSvgUrl (jsDelivr, flag-icons 7.5.0) and the optional country-kit/flags entry for inline SVG
  • getCountriesByRegion(region) overload; the no-argument form still returns { [region]: Country[] }
  • Dataset is generated from ISO 3166-1 and UN M49. Names, calling codes, and coverage follow those sources. Kosovo (XK) is not an assigned ISO 3166-1 code and is not included.
  • getCallingCode returns the ITU-T E.164 country calling code only (1-3 digits). NANP territories that previously returned a concatenated NPA now return +1. Anguilla is +1, not +1264. Use getDialCode or nanpAreaCodes for a phone-input prefix.
  • isValidCallingCode accepts + plus 1-3 digits. isValidCallingCode('+1264') is false. +1 is true.
  • Invalid lookups return undefined. They no longer call console.error.
import { getCallingCode, getDialCode, isValidCallingCode } from 'country-kit';

getCallingCode('AI');        // was '+1264' in 1.x; now '+1'
getDialCode('AI');           // '+1264'
isValidCallingCode('+1264'); // false
isValidCallingCode('+1');    // true
  • searchCountries, isValidCountryCode, isValidCallingCode, getCountriesByCallingCode, getCountriesByRegion()
  • Type exports: Country, CountryCode, CountryData, CountrySearchOptions
  • Unknown alpha-2 lookups log with console.error
  • homepage field in package.json
  • NANP calling codes stored as +1264 (no hyphen), not +1-264
  • getCountryFlag returns undefined for unknown codes instead of calling getFlag on a missing code
  • Version bump only
  • README license badge and Node / browser note
  • package.json metadata
  • ISO 3166-1 alpha-2/3 codes, English short names, calling codes, Unicode flag emoji
  • getCountryByCode, getCountryName, getCallingCode, getAlpha3Code, getCountryFlag, getAllCountries, getFlag