Skip to content

Latest commit

 

History

History
34 lines (29 loc) · 715 Bytes

README.md

File metadata and controls

34 lines (29 loc) · 715 Bytes

global-countries-node-sdk

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)