g-countries
v1.0.4
Published
A static formatted list of the api's countries, nationalities and their flags
Downloads
59
Readme
G Countries
A simple import export of the countries from rest.gadventures.com.
When this package is published, it grabs all the nationalities from gapi
and populates countries.json
, then pushes it to npm.
To run:
npm install -D
echo 'module.exports = "<YOUR_GAPI_KEY_HERE>"' > gapi-key.js
npm run build # to see the results
npm publish # to send updated nationalities to gapi
Flags
The flags listed are hosted on G's media server. The full url can be derived as:
# 4x3 version:
'https://media.gadventures.com/media-server/static/images/svg-country-flags/4x3/'
+ country.flagSVG
# 1x1 version:
'https://media.gadventures.com/media-server/static/images/svg-country-flags/1x1/'
+ country.flagSVG
Results
Results are in the following format:
{
"AD": {
"countryCode": "AD",
"nationality": "Andorran",
"country": "Andorra",
"flagSVG": "ad.svg"
},
"AE": {
"countryCode": "AE",
"nationality": "United Arab Emirates",
"country": "United Arab Emirates",
"flagSVG": "ae.svg"
},
"AF": {
"countryCode": "AF",
"nationality": "Afghanistan",
"country": "Afghanistan",
"flagSVG": "af.svg"
},
...
}