Skip to content

Open source projects to get all the countries in the world, with flags and country code

Notifications You must be signed in to change notification settings

GoodnessEzeokafor/global-countries-node-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Open source projects to get all the countries in the world, with flags and country code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published