country-flags-dial-code

1.2.0 • Public • Published

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

Package Sidebar

Install

npm i country-flags-dial-code

Weekly Downloads

589

Version

1.2.0

License

MIT

Unpacked Size

188 kB

Total Files

4

Last publish

Collaborators

  • michaelolof