README
iso-locale-tools
All world countries and data points about them, as well as tools for interfacing with that data.
Installation
Install with npm or yarn.
npm install iso-locale-tools
yarn add iso-locale-tools
Usage
The full JSON array of all world countries and information about them lives in src/data/countries-expanded.json
.
Each country is represented as an object.
name
common
: common name (in English)official
: officially recognized name (in English)native
: list of names in the country's recognized languages[key: ISO_639_3]
: ISO 639-3 language codecommon
: common name (in native language)official
: officially recognized name (in native language)
alternates
: array of alternate name spellings
flag
: unicode string flagcca2
: ISO 3166-1 alpha-2 codecca3
: ISO 3166-1 alpha-3 codeccn3
: ISO 3166-1 numeric codeioc
: International Olympic Committee codegovernance
isSovereign
: whether or not the country is independent (i.e. is self-governing)governingBody
: the country that governs the dependency (undefined
ifisSovereign
is true)isUNMember
: whether or not the country is a member of the UN (undefined
ifisSovereign
is false)isEU
: (european countries only) whether or not the country is a member of the EUisSchengen
: (european countries only) whether or not the country is a member of the Schengen AreaisEurozone
: (european countries only) whether or not the country is a part of the Eurozone, i.e. whether or not they use the Euro currency
languages
official
: an array of officially recognized languagesname
:common
: the name of the language in Englishnative
: the name of the language in that language
iso639_3
: ISO639-3 language codebcp47
: BCP47 tagiso14924
: ISO15924 script tagiana
: array of assigned IANA tagsisExtinct
: whether or not the language is no longer spokenisSpurious
: whether or not the language is spurious, i.e. questioned if it ever existed
spoken
: list of ISO639-3 language tags of languages spoken in the country, but are not recognized as 'official' languages
geography
coordinates
: numeric coordinates of the center of the countrylatitude
longitude
isLandlocked
: whether or not the country is landlocked (not bordering the ocean)capitalCity
: a list of capital citieslandArea
: size of the country in km2region
: the region the country is in (e.g. 'americas', 'europe')subregion
: the subregion of the country (e.g.carribbean
)borderCountries
: list of countries by their ISO 3166-1 alpha-3 codes that border the country
locale
ietf
: a list of IETF locale codes (e.g.en-US
)measurementSystem
: system of measurement in usedrivingSide
: driving sidehourClock
: type of clock usedtimezones
: list of tz database timezonesname
: name of timezonetype
: the type of timezone (primary or alias)linkedTo
: (if alias) the primary timezone this timezone links toutcOffset
: hours offset from UTCdstOffset
: hours offset from UTC during DST (if country doesn't observe DST, this is the same value as UTC offset)
dateFormats
: date formats for each IETF locale- key is the IETF locale name
- value is the date format, where:
G
= eray
= yearM
= monthd
= day
weekStartsOn
: which day is the first day of the week on the calendardistanceUnit
: the unit of distance used (kilometer or mile)temperatureMeasurement
: the unit of temperature (celsius or fahrenheit)
currencies
: list of accepted currenciesname
: official currency name (in English)shortName
: the name of the currency itself (e.g. 'dollar' as opposed to 'US Dollar')iso4217
: ISO 4217 codeisoNumeric
: ISO 4217 numeric codesymbol
: unicode symbol (e.g. '