{"id":19824756,"url":"https://github.com/stephangeorg/iso-countries-lookup","last_synced_at":"2025-05-01T13:31:38.398Z","repository":{"id":35111376,"uuid":"186176468","full_name":"StephanGeorg/iso-countries-lookup","owner":"StephanGeorg","description":"Find country codes by country names in multiple languages.","archived":false,"fork":false,"pushed_at":"2023-12-14T19:51:12.000Z","size":720,"stargazers_count":8,"open_issues_count":4,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-21T15:10:03.596Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/StephanGeorg.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-05-11T20:01:54.000Z","updated_at":"2023-01-01T14:04:26.000Z","dependencies_parsed_at":"2024-06-19T22:50:15.997Z","dependency_job_id":"c4ba7843-159d-46f4-8424-602b3745446c","html_url":"https://github.com/StephanGeorg/iso-countries-lookup","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanGeorg%2Fiso-countries-lookup","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanGeorg%2Fiso-countries-lookup/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanGeorg%2Fiso-countries-lookup/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StephanGeorg%2Fiso-countries-lookup/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StephanGeorg","download_url":"https://codeload.github.com/StephanGeorg/iso-countries-lookup/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251881705,"owners_count":21659145,"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":[],"created_at":"2024-11-12T11:05:48.350Z","updated_at":"2025-05-01T13:31:38.054Z","avatar_url":"https://github.com/StephanGeorg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iso-countries-lookup [![npm version](https://badge.fury.io/js/iso-countries-lookup.svg)](https://badge.fury.io/js/iso-countries-lookup)\n\nFind country codes (ISO 3166-1 alpha-2) by country names in multiple languages with basic fault tolerance for inputs.\n\nReturns the ISO 3166-1 alpha-2 country code for a given country name. Supports [multiple languages](https://www.npmjs.com/package/i18n-iso-countries#supported-languages-iso-639-1) based on [i18n-iso-countries](https://github.com/michaelwittig/node-i18n-iso-countries)\nand also alternative names based on [world countries data](https://github.com/mledoze/countries).  \n\n## Installation\n\n```\nnpm i iso-countries-lookup\n```\n\n## Usage\n\n```javascript\nimport countryCodeLookup from 'iso-countries-lookup';\n```\n\n```\ncountryCodeLookup(input, [options]);\n```\n\n```javascript\n// Finding ISO Code from official names (fastest)\ncountryCodeLookup('Germany'); // 'DE'\ncountryCodeLookup('United States of America'); // 'US'\ncountryCodeLookup('اليونان'); // 'GR'\ncountryCodeLookup('罗马尼亚'); // 'RO'\ncountryCodeLookup('Côte d\\'Ivoire'); // 'CI'\n\n// Findinding ISO codes from alternative names\ncountryCodeLookup('Bundesrepublik Deutschland'); // 'DE'\ncountryCodeLookup('United states'); // US\ncountryCodeLookup('Iran'); // 'IR'\ncountryCodeLookup('Cote dIvoire'); // 'CI'\n\n// Finding ISO codes from dirty strings\ncountryCodeLookup(', Румыния - '); // Return RO\ncountryCodeLookup(' , DEU') // DE\ncountryCodeLookup('uk') // UK\n\n// Finding ISO codes from Numeric\ncountryCodeLookup(184) // CK\ncountryCodeLookup('004') // AF\n\n// Finding ISO codes from Numeric\ncountryCodeLookup(184, { numeric: false }) // undefined\ncountryCodeLookup('004', { numeric: false }) // undefined\n\n```\n\n## Options\n\nParameter           | Default             | Description\n------------------- | ------------------- | -------------\nnumeric             | true                | ISO 3166-1 numeric values in input \n\n## Returns\n\nThe [ISO 3166-1 alpha-2 code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of a country or `undefined`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephangeorg%2Fiso-countries-lookup","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstephangeorg%2Fiso-countries-lookup","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstephangeorg%2Fiso-countries-lookup/lists"}