1.0.4 • Published 5 years ago

g-countries v1.0.4

Weekly downloads
22
License
ISC
Repository
-
Last release
5 years ago

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"
 },
 ...
}