country-flags-dial-code
v1.2.0
Published
A Utility library for mapping countries, dial codes and their flags in SVG
Downloads
2,985
Maintainers
Readme
Countries Flag Dial Codes
A Utility library for mapping countries, dial codes and their flags in SVG.
Installation
$ npm install --save country-flags-dial-code
API
getCountryListMap()
/**
* Returns a dictionary of countries with their flags, name and codes (E.g)
* {
* "AC": {
* "flag": "<svg xmlns='http:/>..."
* "code": "AC",
* "country": "Ascension Island",
* "dialCode": "+247"
* }
* ...
* }
getCountryDialCode(countryCode)
/**
* Returns the dial code for a given country (E.g)
* "+247"
getCountryName(countryCode)
/**
* Returns the dial code for a given country (E.g)
* "Ascension Island"
getCountryFlag(countryCode)
/**
* Returns the dial code for a given country (E.g)
* "<svg xmlns='http:/>..."