{"id":15028496,"url":"https://github.com/annexare/countries","last_synced_at":"2026-03-04T17:03:16.139Z","repository":{"id":18363833,"uuid":"21544060","full_name":"annexare/Countries","owner":"annexare","description":"Countries, Languages \u0026 Continents data (capital and currency, native name, calling codes).","archived":false,"fork":false,"pushed_at":"2024-08-13T12:53:19.000Z","size":1792,"stargazers_count":1227,"open_issues_count":16,"forks_count":429,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-04-01T23:19:54.443Z","etag":null,"topics":["calling-codes","capital","cjs","continent","countries","country-codes","csv","currencies","emoji","esm","iso3166","iso3166-1","iso639","iso639-1","json","language-codes","locales","sql","typescript","typings"],"latest_commit_sha":null,"homepage":"https://annexare.github.io/Countries/","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/annexare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-07-06T16:44:51.000Z","updated_at":"2025-03-31T06:53:43.000Z","dependencies_parsed_at":"2024-03-04T17:14:35.115Z","dependency_job_id":"f0b299d9-dc2f-4a3a-9557-9ade6e029856","html_url":"https://github.com/annexare/Countries","commit_stats":{"total_commits":183,"total_committers":19,"mean_commits":9.631578947368421,"dds":0.5846994535519126,"last_synced_commit":"cc382a4045cc7ca1ecd4c479de402dee1ba28929"},"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexare%2FCountries","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexare%2FCountries/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexare%2FCountries/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/annexare%2FCountries/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/annexare","download_url":"https://codeload.github.com/annexare/Countries/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247949056,"owners_count":21023267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["calling-codes","capital","cjs","continent","countries","country-codes","csv","currencies","emoji","esm","iso3166","iso3166-1","iso639","iso639-1","json","language-codes","locales","sql","typescript","typings"],"created_at":"2024-09-24T20:08:28.313Z","updated_at":"2026-03-04T17:03:16.134Z","avatar_url":"https://github.com/annexare.png","language":"TypeScript","readme":"# Countries, Languages \u0026 Continents data\n\n[![Monthly Downloads](https://img.shields.io/npm/dm/countries-list.svg)](https://www.npmjs.com/package/countries-list)\n[![NPM](https://img.shields.io/npm/v/countries-list.svg 'NPM package version')](https://www.npmjs.com/package/countries-list)\n[![Packagist](https://img.shields.io/packagist/v/annexare/countries-list.svg 'Packagist version')](https://packagist.org/packages/annexare/countries-list)\n[![CI: JS](https://github.com/annexare/Countries/workflows/Countries%20JS/badge.svg 'CI: JS')](https://github.com/annexare/Countries/actions)\n[![CI: PHP](https://github.com/annexare/Countries/workflows/Countries%20PHP/badge.svg 'CI: PHP')](https://github.com/annexare/Countries/actions)\n[![Twitter](https://img.shields.io/twitter/follow/annexare.svg?label=follow+@annexare)](https://twitter.com/annexare)\n\nContinents \u0026 countries: **ISO 3166-1 alpha-2** code (with **alpha-2** to **alpha-3** set), name, **ISO 639-1** languages, capital and **ISO 4217** currency codes, native name, calling codes.\nLists are available in JSON, CSV and SQL formats.\nAlso, contains separate JSON files with additional country **Emoji** flags data.\n\n## Version 3.0: Breaking changes\n\nVersion 3 comes with some data structure changes.\nIt was completely reworked under the hood with **TypeScript**, **ESM** exports and **Turborepo** file structure.\n\nEverything is strongly typed so you can easily use data with auto-complete in your IDE.\n\n**Note**: If your projects depend on the old structure, carefully specify required versions in your dependencies.\n\n## Installation\n\nPackage is available via:\n\n- **Bun** `bun add countries-list`\n- **NPM** `npm install countries-list`\n- **Composer / Packagist** `composer require annexare/countries-list`\n\n## Usage (version 3.x)\n\nModule exports `continents`, `countries`, `languages` and utility functions.\n\n```ts\n// Interfaces and types\nimport type {\n  ICountry,\n  ICountryData,\n  ILanguage,\n  TContinentCode,\n  TCountryCode,\n  TLanguageCode,\n} from 'countries-list'\n\n// Main data and utils\nimport { continents, countries, languages } from 'countries-list'\n// Utils\nimport { getCountryCode, getCountryData, getCountryDataList, getEmojiFlag } from 'countries-list'\n\n// Minimal data in JSON\nimport countries2to3 from 'countries-list/minimal/countries.2to3.min.json'\nimport countries3to2 from 'countries-list/minimal/countries.3to2.min.json'\nimport languageNames from 'countries-list/minimal/languages.native.min'\n\ngetCountryCode('Ukraine') // 'UA'\ngetCountryCode('Україна') // 'UA'\ngetCountryData('UA') // ICountryData\n```\n\nBuilt files are in the `dist` directory of this repository, and `packages/countries` directory contains source data.\n\n**Note**: JS build contains ES modules, CommonJS and IIFE (for now)\n\n- CJS `cjs/index.js`\n- ESM `mjs/index.js`\n- IIFE `index.iife.js`\n\n## Data structure examples\n\n```ts\nconst continents = {\n  AF: 'Africa',\n  AN: 'Antarctica',\n  AS: 'Asia',\n  EU: 'Europe',\n  NA: 'North America',\n  OC: 'Oceania',\n  SA: 'South America',\n}\n\nconst countries = {\n  // ...\n  UA: {\n    name: 'Ukraine',\n    native: 'Україна',\n    phone: [380],\n    continent: 'EU',\n    capital: 'Kyiv',\n    currency: ['UAH'],\n    languages: ['uk'],\n  },\n  // ...\n}\n\nconst languages = {\n  // ...\n  uk: {\n    name: 'Ukrainian',\n    native: 'Українська',\n  },\n  ur: {\n    name: 'Urdu',\n    native: 'اردو',\n    rtl: 1,\n  },\n  // ...\n}\n```\n\n## Contributing to this repository\n\nEverything is generated from strongly typed files in `packages/countries/src`, including SQL file.\n\nEverything in `dist` is generated,\nso please make data related changes **ONLY** to files from `packages/countries`, commit them.\nUse `bun run build` (or `turbo build`, `turbo test`) command to build/test generated files.\n\n## Credits\n\nPrepared by [Annexare Studio](https://annexare.com/) from different public sources.\nFeel free to use it as you need in your apps\nor send updates into [this](https://github.com/annexare/Countries) public repository.\nIt's under MIT license.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannexare%2Fcountries","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fannexare%2Fcountries","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fannexare%2Fcountries/lists"}