1.2.0 • Published 3 years ago

country-flags-dial-code v1.2.0

Weekly downloads
16
License
MIT
Repository
github
Last release
3 years ago

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:/>..."