1.0.5 • Published 6 years ago
country-all-data v1.0.5
Get Country states ,codes, currency codes, emojis, phone codes (case insensitive).
Goals of this project is to get any country information.
Installing
npm i country-all-dataRequirements
There are lots of little bits of data that you often need relating to countries, and I couldn't find any easy to use source of it. So I compiled it all here.
Usage
Example
  let countryAllData = require('country-all-data');
  or
  import countryAllData from 'country-all-data';
  countryAllData.getAllCountries().catch((err) => {
      console.log(`Error received: `, err.message);
  }).then((data) => {
      console.log(data);
  });Data example
{
  "countries": [
    {
      "country": "India",
      "states": [object],
      "code": "IN",
      "currency_code": "INR",
      "flag_base64": "data:image/svg+xml;base64.................",
      "phone": "91"
    },
    {
      "country": "United States",
      "states": [object],
      "code": "US",
      "currency_code": "USD",
      "flag_base64": "data:image/svg+xml;base64,PHN2sZyB4bWx.....",
      "phone": "1"
    },
    ...
}Work in Progress
- feel free to use it, but be sure to check between upgrades.