{"id":43123974,"url":"https://github.com/amplifiedhq/countries-atlas","last_synced_at":"2026-01-31T20:06:03.817Z","repository":{"id":187760631,"uuid":"675876046","full_name":"amplifiedhq/countries-atlas","owner":"amplifiedhq","description":"Uncover the world with a single lightweight library - countries, codes, currencies, flags, languages, cities, and more 🌎","archived":false,"fork":false,"pushed_at":"2026-01-24T12:50:05.000Z","size":7146,"stargazers_count":10,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-24T22:07:56.792Z","etag":null,"topics":["cities","country","currency","flags","iso3166","iso3166-1","nodejs","npm","npmpackage","phone-number","timezones"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@amplifiedhq/countries-atlas","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amplifiedhq.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-08-08T00:06:15.000Z","updated_at":"2026-01-24T12:50:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"264474c6-58c6-46ab-b8b0-28474b683112","html_url":"https://github.com/amplifiedhq/countries-atlas","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"f26592905dd7f171ba26f99d815bf4af2538f308"},"previous_names":["amplifiedhq/countries-atlas"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/amplifiedhq/countries-atlas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplifiedhq%2Fcountries-atlas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplifiedhq%2Fcountries-atlas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplifiedhq%2Fcountries-atlas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplifiedhq%2Fcountries-atlas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amplifiedhq","download_url":"https://codeload.github.com/amplifiedhq/countries-atlas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amplifiedhq%2Fcountries-atlas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28952587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-31T18:30:42.805Z","status":"ssl_error","status_checked_at":"2026-01-31T18:30:19.593Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cities","country","currency","flags","iso3166","iso3166-1","nodejs","npm","npmpackage","phone-number","timezones"],"created_at":"2026-01-31T20:06:03.733Z","updated_at":"2026-01-31T20:06:03.800Z","avatar_url":"https://github.com/amplifiedhq.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CountriesAtlas 🌎\nUncover the world with a single lightweight library - countries, codes, currencies, flags, languages, cities, and more 🌎\n\n![GitHub license](https://img.shields.io/github/license/amplifiedhq/countries-atlas) ![npm version](https://img.shields.io/npm/v/@amplifiedhq/countries-atlas) ![npm downloads](https://img.shields.io/npm/dt/@amplifiedhq/countries-atlas) ![GitHub issues](https://img.shields.io/github/issues/amplifiedhq/countries-atlas) ![GitHub action](https://img.shields.io/github/actions/workflow/status/amplifiedhq/countries-atlas/.github/workflows/coverage.yml?branch=main)\n## Installation 📦\nYou can install CountriesAtlas using npm registry, run the following command:\n```bash\nnpm install @amplifiedhq/countries-atlas\n```\n## Features 🌟\n- Rich Data Sources\n    The library is based on extensive dataset from [Kaggle](https://www.kaggle.com/datasets/tanweerulhaque/countries-states-cities-dataset), which is a collection of countries, states, cities, currencies, and languages etc.\n- Easy to Use\n    The library is designed to be easy to use, you can get the data you want with just a few lines of code.\n- Load on Demand\n    The library is heavy, so we provide a way to load the data on demand, which means you can load the data you want, and the library will only load the data you need.\n- Validation\n    The library provides a way to validate the data, which means you can countries, iso codes, currencies, and languages etc. with ease. You can simply use the provided method in your server side code like Express.js, Nest.js, or Koa.js etc.\n- Dynamic Input\n    The library provides a way to get the data dynamically, which means you can use the data on your client side code like React.js, Vue.js, or Angular.js etc. The provided methods can be integrated in your inputs like select, autocomplete, or typeahead etc. for better user experience.\n    - Phone Input\n    - Country Input\n    - Currency Input\n    - Language Input\n    - State Input\n    - City Input\n    - Timezone Input\n    - etc.\n## Usage 🚀\n\n\u003e [!WARNING]\n\u003e If you are using Vite.js as your build tool or Nuxt, follow the [Vite.js and Nuxt Setup](#vitejs-and-nuxt-setup) section.\n\n### CountriesAtlas Class 🌎\nIn order to use the country atlas class, you need to import the class from the library, and create an instance of the class.\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\n```\n### getCountries() 🌎 Method\nThe `getCountries()` method will return an array of countries, which contains all the countries in the world. It also contains the following properties:\n- code: The ISO 3166-1 alpha-2 code of the country.\n- name: The name of the country.\n- native: The native name of the country.\n- phone: The phone code of the country.\n- continent: The continent of the country.\n- capital: The capital of the country.\n- currency: The currency of the country.\n- languages: The languages of the country.\n- iso3: The ISO 3166-1 alpha-3 code of the country.\n- iso2: The ISO 3166-1 alpha-2 code of the country.\n- currency_symbol: The currency symbol of the country.\n- region: The region of the country.\n- subregion: The subregion of the country.\n- timezones: The timezones of the country.\n- translations: The translations of the country.\n- latitude: The latitude of the country.\n- longitude: The longitude of the country.\n- emoji: The emoji of the country.\n- emojiU: The emoji unicode of the country.\n- currency_name: The currency name of the country.\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst countries = CountriesAtlas.getCountries()\n//[\n//  {\n//     \"code\": \"AD\",\n//     \"name\": \"Andorra\",\n//     \"native\": \"Andorra\",\n//     \"phone\": 376,\n//     \"continent\": \"Europe\",\n//     \"capital\": \"Andorra la Vella\",\n//     \"currency\": \"EUR\",\n//     \"languages\": \"ca\",\n//     \"iso3\": \"AND\",\n//     \"iso2\": \"AD\",\n//     \"currency_symbol\": \"€\",\n//     \"region\": \"Europe\",\n//     \"subregion\": \"Southern Europe\",\n//     \"timezones\": [\n//       {\n//         \"zoneName\": \"Europe/Andorra\",\n//         \"gmtOffset\": 3600,\n//         \"gmtOffsetName\": \"UTC+01:00\",\n//         \"abbreviation\": \"CET\",\n//         \"tzName\": \"Central European Time\"\n//       }\n//     ],\n//     \"translations\": {\n//       \"kr\": \"안도라\",\n//       \"br\": \"Andorra\",\n//       \"pt\": \"Andorra\",\n//       \"nl\": \"Andorra\",\n//       \"hr\": \"Andora\",\n//       \"fa\": \"آندورا\",\n//       \"de\": \"Andorra\",\n//       \"es\": \"Andorra\",\n//       \"fr\": \"Andorre\",\n//       \"ja\": \"アンドラ\",\n//       \"it\": \"Andorra\",\n//       \"cn\": \"安道尔\"\n//     },\n//     \"latitude\": \"42.50000000\",\n//     \"longitude\": \"1.50000000\",\n//     \"emoji\": \"🇦🇩\",\n//     \"emojiU\": \"U+1F1E6 U+1F1E9\",\n//     \"currency_name\": \"Euro\"\n//   },\n//]\n```\nYou can use any of the properties in the `getCountries()` method to extract the data you want, for example, if you want to get the name, iso2, and emoji of the country, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst countries = CountriesAtlas.getCountries(['name', 'iso2', 'emoji'])\n//[\n//  {\n//     \"name\": \"Andorra\",\n//     \"iso2\": \"AD\",\n//     \"emoji\": \"🇦🇩\"\n//   },\n//]\n```\n### find() 🌎 Method\nThe `find()` method is used to find the country by the given `iso2` property, it will return the country if it exists, otherwise it will return `undefined`. For example, if you want to find the country, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst country = CountriesAtlas.find('AD')\n//[\n//  {\n//     \"code\": \"AD\",\n//     \"name\": \"Andorra\",\n//     \"native\": \"Andorra\",\n//     \"phone\": 376,\n//     \"continent\": \"Europe\",\n//     \"capital\": \"Andorra la Vella\",\n//     \"currency\": \"EUR\",\n//     \"languages\": \"ca\",\n//     \"iso3\": \"AND\",\n//     \"iso2\": \"AD\",\n//     \"currency_symbol\": \"€\",\n//     \"region\": \"Europe\",\n//     \"subregion\": \"Southern Europe\",\n//     \"timezones\": [\n//       {\n//         \"zoneName\": \"Europe/Andorra\",\n//         \"gmtOffset\": 3600,\n//         \"gmtOffsetName\": \"UTC+01:00\",\n//         \"abbreviation\": \"CET\",\n//         \"tzName\": \"Central European Time\"\n//       }\n//     ],\n//     \"translations\": {\n//       \"kr\": \"안도라\",\n//       \"br\": \"Andorra\",\n//       \"pt\": \"Andorra\",\n//       \"nl\": \"Andorra\",\n//       \"hr\": \"Andora\",\n//       \"fa\": \"آندورا\",\n//       \"de\": \"Andorra\",\n//       \"es\": \"Andorra\",\n//       \"fr\": \"Andorre\",\n//       \"ja\": \"アンドラ\",\n//       \"it\": \"Andorra\",\n//       \"cn\": \"安道尔\"\n//     },\n//     \"latitude\": \"42.50000000\",\n//     \"longitude\": \"1.50000000\",\n//     \"emoji\": \"🇦🇩\",\n//     \"emojiU\": \"U+1F1E6 U+1F1E9\",\n//     \"currency_name\": \"Euro\"\n//   },\n//]\n\n// You can also get any property you want from the country by using the . operator\nconst countryName = CountriesAtlas.find('AD')?.name\n// Andorra\n```\n### findByIso3() 🌎 Method\nThe `findByIso3()` method is used to find the country by the given `iso3` property, it will return the country if it exists, otherwise it will return `undefined`. For example, if you want to find the country, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst country = CountriesAtlas.findByIso3('AND')\n//[\n//  {\n//     \"code\": \"AD\",\n//     \"name\": \"Andorra\",\n//     \"native\": \"Andorra\",\n//     \"phone\": 376,\n//     \"continent\": \"Europe\",\n//     \"capital\": \"Andorra la Vella\",\n//     \"currency\": \"EUR\",\n//     \"languages\": \"ca\",\n//     \"iso3\": \"AND\",\n//     \"iso2\": \"AD\",\n//     \"currency_symbol\": \"€\",\n//     \"region\": \"Europe\",\n//     \"subregion\": \"Southern Europe\",\n//     \"timezones\": [\n//       {\n//         \"zoneName\": \"Europe/Andorra\",\n//         \"gmtOffset\": 3600,\n//         \"gmtOffsetName\": \"UTC+01:00\",\n//         \"abbreviation\": \"CET\",\n//         \"tzName\": \"Central European Time\"\n//       }\n//     ],\n//     \"translations\": {\n//       \"kr\": \"안도라\",\n//       \"br\": \"Andorra\",\n//       \"pt\": \"Andorra\",\n//       \"nl\": \"Andorra\",\n//       \"hr\": \"Andora\",\n//       \"fa\": \"آندورا\",\n//       \"de\": \"Andorra\",\n//       \"es\": \"Andorra\",\n//       \"fr\": \"Andorre\",\n//       \"ja\": \"アンドラ\",\n//       \"it\": \"Andorra\",\n//       \"cn\": \"安道尔\"\n//     },\n//     \"latitude\": \"42.50000000\",\n//     \"longitude\": \"1.50000000\",\n//     \"emoji\": \"🇦🇩\",\n//     \"emojiU\": \"U+1F1E6 U+1F1E9\",\n//     \"currency_name\": \"Euro\"\n//   },\n//]\n\n// You can also get any property you want from the country by using the . operator\nconst countryName = CountriesAtlas.findByIso3('AND')?.name\n// Andorra\n```\n### getStates() 🌎 Method\nThe `getStates()` method will return an array of states by `iso2` property, which contains all the states in a country. It also contains the following properties:\n- name: The name of the state.\n- state_code: The state code of the state.\n- longitude: The longitude of the state.\n- latitude: The latitude of the state.\n- cities: The cities of the state.\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst states = CountriesAtlas.getStates('AD')\n// [\n//     {\n//       \"name\": \"Andorra la Vella\",\n//       \"state_code\": \"07\",\n//       \"latitude\": \"42.50631740\",\n//       \"longitude\": \"1.52183550\",\n//       \"cities\": [\n//         {\n//           \"name\": \"Andorra la Vella\",\n//           \"latitude\": \"42.50779000\",\n//           \"longitude\": \"1.52109000\"\n//         }\n//       ]\n//     },\n// ]\n```\n### state() 🌎 Method\nThe `state()` method is used to get the state by the given `iso2` and `state_code` properties, it will return the state if it exists, otherwise it will return `undefined`. For example, if you want to get the state, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst state = CountriesAtlas.state('AD', '07')\n//{\n//  \"name\": \"Andorra la Vella\",\n//  \"state_code\": \"07\",\n//  \"latitude\": \"42.50631740\",\n//  \"longitude\": \"1.52183550\",\n//  \"cities\": [\n//    {\n//      \"name\": \"Andorra la Vella\",\n//      \"latitude\": \"42.50779000\",\n//      \"longitude\": \"1.52109000\"\n//    }\n//  ]\n//}\n\n// You can also get any property you want from the state by using the . operator\nconst stateName = CountriesAtlas.state('AD', '07')?.name\n// Andorra la Vella\n```\n### getTimezones() ⏰ Method\nThe `getTimezones()` method will return an array of timezones, which contains all the timezones available. It also contains the following properties:\n- zoneName: The zone name of the timezone.\n- gmtOffset: The GMT offset of the timezone.\n- gmtOffsetName: The GMT offset name of the timezone.\n- abbreviation: The abbreviation of the timezone.\n- tzName: The timezone name of the timezone.\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst timezones = CountriesAtlas.getTimezones()\n// [\n//   {\n//     \"zoneName\": \"Europe/Andorra\",\n//     \"gmtOffset\": 3600,\n//     \"gmtOffsetName\": \"UTC+01:00\",\n//     \"abbreviation\": \"CET\",\n//     \"tzName\": \"Central European Time\"\n//   },\n//   {\n//     \"zoneName\": \"Asia/Dubai\",\n//     \"gmtOffset\": 14400,\n//     \"gmtOffsetName\": \"UTC+04:00\",\n//     \"abbreviation\": \"GST\",\n//     \"tzName\": \"Gulf Standard Time\"\n//   },\n// ]\n```\n\n### timezone() ⏰ Method\nThe `timezone()` method is used to get the timezone of a country by the given `iso2` property, it will return the timezone if it exists, otherwise it will return `undefined`. For example, if you want to get the timezone, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst timezone = CountriesAtlas.timezone('AD')\n// {\n//   \"zoneName\": \"Europe/Andorra\",\n//   \"gmtOffset\": 3600,\n//   \"gmtOffsetName\": \"UTC+01:00\",\n//   \"abbreviation\": \"CET\",\n//   \"tzName\": \"Central European Time\"\n// }\n\n// You can also get any property you want from the timezone by using the . operator\nconst timezoneName = CountriesAtlas.timezone('AD')?.[0]?.tzName\n// Central European Time\n```\n### getCallingCodes() ☎️ Method\nThe `getCallingCodes()` method will return an array of calling codes, which contains all the calling codes available. It also contains the following properties:\n- name: The name of the country.\n- phone: The phone code of the country.\n- iso2: The ISO 3166-1 alpha-2 code of the country.\n- phone_code: The phone code of the country with + sign as prefix.\n- flag: The flag class of the country. **Note: to use the flag class, you need to import the flag css file from the library.**\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst callingCodes = CountriesAtlas.getCallingCodes()\n// [\n//   {\n//     \"name\": \"Andorra\",\n//     \"phone\": 376,\n//     \"iso2\": \"AD\",\n//     \"phone_code\": \"+376\",\n//     \"flag\": \"flag flag-ad\"\n//   },\n//   {\n//     \"name\": \"United Arab Emirates\",\n//     \"phone\": 971,\n//     \"iso2\": \"AE\",\n//     \"phone_code\": \"+971\",\n//     \"flag\": \"flag flag-ae\"\n//   },\n// ]\n```\n***Note: If you want to use the flag class, you need to import the flag css file from the library, to do that [click here](#flag-css-file-).***\n\n### callingCode() ☎️ Method\nThe `callingCode()` method is used to get the calling code of a country by the given `iso2` property, it will return the calling code if it exists, otherwise it will return `undefined`. For example, if you want to get the calling code, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst callingCode = CountriesAtlas.callingCode('AD')\n// {\n//   \"name\": \"Andorra\",\n//   \"phone\": 376,\n//   \"iso2\": \"AD\",\n//   \"phone_code\": \"+376\",\n//   \"flag\": \"flag flag-ad\"\n// }\n```\n### getCurrencies() 💰 Method\nThe `getCurrencies()` method will return an array of currencies, which contains all the currencies available. It also contains the following properties:\n- name: The name of the country.\n- iso2: The ISO 3166-1 alpha-2 code of the country.\n- currency code: The currency code of the country.\n- currency_symbol: The currency symbol of the country.\n- flag: The flag class of the country. **Note: to use the flag class, you need to import the flag css file from the library.**\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst currencies = CountriesAtlas.getCurrencies()\n// [\n//   {\n//     \"name\": \"Andorra\",\n//     \"iso2\": \"AD\",\n//     \"currency\": \"EUR\",\n//     \"currency_symbol\": \"€\",\n//     \"currency_name\": \"Euro\",\n//     \"flag\": \"flag flag-ad\"\n//   },\n//   {\n//     \"name\": \"United Arab Emirates\",\n//     \"iso2\": \"AE\",\n//     \"currency\": \"AED\",\n//     \"currency_symbol\": \"إ.د\",\n//     \"flag\": \"flag flag-ae\"\n//   },\n// ]\n```\n***Note: If you want to use the flag class, you need to import the flag css file from the library, to do that [click here](#flag-css-file-).***\n\n### currency() 💰 Method\nThe `currency()` method is used to get the currency of a country by the given `iso2` property, it will return the currency if it exists, otherwise it will return `undefined`. For example, if you want to get the currency, you can do the following:\n```typescript\nimport { CountriesAtlas } from '@amplifiedhq/countries-atlas'\nconst currency = CountriesAtlas.currency('AD')\n// {\n//   \"name\": \"Andorra\",\n//   \"iso2\": \"AD\",\n//   \"currency\": \"EUR\",\n//   \"currency_symbol\": \"€\",\n//   \"currency_name\": \"Euro\",\n//   \"flag\": \"flag flag-ad\"\n// }\n```\n\n## ValidatorAtlas Class 🧾\nIn order to use the validator atlas class, you need to import the class from the library, and create an instance of the class.\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n```\n### isValidIso2() 🌎 Method\nThe `isValidIso2()` method is used to validate the given `iso2` property, it will return `true` if the `iso2` is valid, otherwise it will return `false`. For example, if you want to validate the `iso2`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidIso2('AD')\n// true\nconst isValid = ValidatorAtlas.isValidIso2('ABC')\n// false\n```\n### isValidIso3() 🌎 Method\nThe `isValidIso3()` method is used to validate the given `iso3` property, it will return `true` if the `iso3` is valid, otherwise it will return `false`. For example, if you want to validate the `iso3`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidIso3('AND')\n// true\nconst isValid = ValidatorAtlas.isValidIso3('ABC')\n// false\n```\n### isValidCurrency() ☎️ Method\nThe `isValidCurrency()` method is used to validate the given `currency` property, it will return `true` if the `currency` is valid, otherwise it will return `false`. For example, if you want to validate the `currency`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidCurrency('EUR')\n// true\nconst isValid = ValidatorAtlas.isValidCurrency('ABC')\n// false\n```\n### isValidTimezone() ⏰ Method\nThe `isValidTimezone()` method is used to validate the given `timezone` property, it will return `true` if the `timezone` is valid, otherwise it will return `false`. For example, if you want to validate the `timezone`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidTimezone('Europe/Andorra')\n// true\nconst isValid = ValidatorAtlas.isValidTimezone('ABC')\n// false\n```\n### isValidCallingCode() ☎️ Method\nThe `isValidCallingCode()` method is used to validate the given `callingCode` property, it will return `true` if the `callingCode` is valid, otherwise it will return `false`. For example, if you want to validate the `callingCode`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidCallingCode('376')\n// true\nconst isValid = ValidatorAtlas.isValidCallingCode('ABC')\n// false\n```\n### isValidStateCode() 🌎 Method\nThe `isValidStateCode()` method is used to validate the given `stateCode` property, it will return `true` if the `stateCode` is valid, otherwise it will return `false`. For example, if you want to validate the `stateCode`, you can do the following:\n```typescript\nimport { ValidatorAtlas } from '@amplifiedhq/countries-atlas'\n\nconst isValid = ValidatorAtlas.isValidStateCode('AD', '07')\n// true\nconst isValid = ValidatorAtlas.isValidStateCode('AD', 'ABC')\n// false\n```\n\n## Flags 🚩\nThe library provides a way to use the flags of the countries, you can use the flag class to display the flag of the country. \n\n### Flag CSS File 🚩\nIn order to use the flag class, you need to import the flag css file from the library, you can do that by adding the following line in your `index.html` file:\n```html\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css\" /\u003e\n\n\u003c!-- Or you can use the local file --\u003e\n\u003clink rel=\"stylesheet\" href=\"node_modules/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css\" /\u003e\n\n\u003c!-- Or you can use the CDN --\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css\"\u003e\n```\nYou can also import the css in your `css` file:\n```css\n@import '~@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css';\n\n/* Or you can use the CDN */\n@import 'https://cdn.jsdelivr.net/npm/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css';\n\n/* Or you can use the local file */\n@import 'node_modules/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css';\n\n/* Or you can use the unpkg */\n@import 'https://unpkg.com/@amplifiedhq/countries-atlas/dist/flags/css/flags.min.css';\n```\nIn order to use the flag class, you need to add the flag class to the element, for example, if you want to display the flag of the country, you can do the following:\n```html\n\u003cspan class=\"flag flag-ad\"\u003e\u003c/span\u003e\n\u003cspan class=\"flag flag-ae\"\u003e\u003c/span\u003e\n```\n### Flag SCSS File 🚩\nIn order to use the flag class, you need to import the flag scss file from the library, you can do that by adding the following line in your `index.html` file:\n```html\n\u003clink rel=\"stylesheet\" href=\"node_modules/@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss\" /\u003e\n\n\u003c!-- Or you can use the CDN --\u003e\n\u003clink rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss\"\u003e\n\n\u003c!-- Or you can use the unpkg --\u003e\n\u003clink rel=\"stylesheet\" href=\"https://unpkg.com/@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss\"\u003e\n```\nYou can also import the scss in your `scss` file:\n```scss\n@import '~@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss';\n\n/* Or you can use the CDN */\n\n@import 'https://cdn.jsdelivr.net/npm/@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss';\n\n/* Or you can use the unpkg */\n\n@import 'https://unpkg.com/@amplifiedhq/countries-atlas/dist/flags/scss/flags.scss';\n```\n\nIn order to use the flag class, you need to add the flag class to the element, for example, if you want to display the flag of the country, you can do the following:\n```html\n\u003cspan class=\"flag flag-ad\"\u003e\u003c/span\u003e\n\u003cspan class=\"flag flag-ae\"\u003e\u003c/span\u003e\n```\n\n## Flags Import 🚩\nYou can import the flags in your project, you can do that by importing the `flags` folder from the library, for example, if you want to import the flags in your app, you can do the following:\n- Vue.js\n```javascript\n\u003ctemplate\u003e\n  \u003cdiv\u003e\n    \u003cimg :src=\"AD\" /\u003e\n    \u003cimg :src=\"AE\" /\u003e\n    \u003c/div\u003e\n\u003c/template\u003e\n\n\u003cscript\u003e\nimport { AD, AE } from '@amplifiedhq/countries-atlas/dist/flags';\n\nexport default {\n  name: 'App',\n  data() {\n    return {\n      AD,\n      AE,\n    }\n  }\n}\n\u003c/script\u003e\n```\n- React.js\n```jsx\nimport { AD, AE } from '@amplifiedhq/countries-atlas/dist/flags';\n\nconst App = () =\u003e {\n  return (\n    \u003cdiv\u003e\n      \u003cimg src={AD} /\u003e\n      \u003cimg src={AE} /\u003e\n    \u003c/div\u003e\n  );\n}\n\nexport default App;\n```\n\n### Vite.js and Nuxt Setup\nIf you are using Vite.js as your build tool, you need to install the `@rollup/plugin-commonjs` plugin, you can do that by running the following command:\n```bash\nnpm install @rollup/plugin-commonjs\n```\nThen you need to add the following configuration in your `vite.config.js` file to avoid CommonJS Dynamic Require Error:\n```javascript\nimport { defineConfig } from 'vite'\nimport vue from '@vitejs/plugin-vue'\nimport commonjs from '@rollup/plugin-commonjs';\n\n// https://vitejs.dev/config/\nexport default defineConfig({\n  plugins: [\n    vue(),\n    commonjs({\n      dynamicRequireTargets: [\n        // include using a glob pattern (either a string or an array of strings)\n        'node_modules/@amplifiedhq/countries-atlas/dist/data/**/*.json',\n      ]\n    }),\n  ],\n})\n```\nFor Nuxt.js, you need to add the following configuration in your `nuxt.config.js` file to avoid CommonJS Dynamic Require Error:\n```javascript\nexport default defineNuxtConfig({\n  build: {\n    transpile: ['@amplifiedhq/countries-atlas'],\n  }\n}\n```\n\nIf you still face the issue, you can install the patch version, which uses static imports instead of dynamic imports, you can do that by running the following command:\n```bash\nnpm install @amplifiedhq/countries-atlas@1.4.13\n```\nThis patch version is only for Vite.js and Nuxt.js users, if you are using other build tools, you can use the latest version. The patch version may use more memory and may not have the latest features, so it's recommended to use the latest version if you are not using Vite.js or Nuxt.js.\n\n## Contributing 🤝\nContributions, issues and feature requests are welcome. After cloning \u0026 setting up project locally, you can just submit a PR to this repo and it will be deployed once it's accepted.\n\n## Show your support 🌟\nGive a ⭐️ if this project helped you!\n\n## License 📝\nThis project is [MIT](LICENSE.md) licensed.\n\n## Credits 🙏\n- [Kaggle](https://www.kaggle.com/datasets/tanweerulhaque/countries-states-cities-dataset) for the dataset.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplifiedhq%2Fcountries-atlas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famplifiedhq%2Fcountries-atlas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famplifiedhq%2Fcountries-atlas/lists"}