Nodejs sdk for getting all countries, their call codes, Alpha-2 code/ Alpha-3 code and flags.
npm i global-countries
// Require the library
const globalCountries = require('global-countries')
const countries = globalCountries.countries()
console.log(countries)
// Get capital
const country = "IRAQ"
const iraqCapital = globalCountries.getCountryCapital(country)
console.log("Capital of IRAQ is", iraqCapital.toUpperCase())
// Get flag
const country = "IRAQ"
const iraqFlag = globalCountries.getCountryFlag(country)
// get call code
const country = "IRAQ"
const iraqCallCode = globalCountries.getCountryCallCode(country)