{"id":21414866,"url":"https://github.com/magic/iso-3166","last_synced_at":"2025-03-16T18:42:03.542Z","repository":{"id":58889088,"uuid":"534390383","full_name":"magic/iso-3166","owner":"magic","description":"iso-3166 country codes and subdivisions","archived":false,"fork":false,"pushed_at":"2022-09-08T21:03:13.000Z","size":240,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-23T09:48:53.885Z","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":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magic.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}},"created_at":"2022-09-08T20:55:43.000Z","updated_at":"2022-12-09T07:45:48.000Z","dependencies_parsed_at":"2022-09-09T06:10:48.966Z","dependency_job_id":null,"html_url":"https://github.com/magic/iso-3166","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fiso-3166","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fiso-3166/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fiso-3166/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magic%2Fiso-3166/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magic","download_url":"https://codeload.github.com/magic/iso-3166/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243911273,"owners_count":20367651,"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-22T18:34:06.281Z","updated_at":"2025-03-16T18:42:03.522Z","avatar_url":"https://github.com/magic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @magic/iso-3166\n\nExports an array of the iso-3166-1 countrycodes and iso-3166-2 subdivisions.\n\nState of January of 2022\n\n[html-docs](https://magic.github.io/iso-3166/)\n\n[![NPM version][npm-image]][npm-url]\n[![Linux Build Status][travis-image]][travis-url]\n[![Windows Build Status][appveyor-image]][appveyor-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n[![Known Vulnerabilities][snyk-image]][snyk-url]\n\n### installation\n\nbe in a nodejs project\n\n```bash\nnpm install --save-exact @magic/iso-3166\n```\n\n### import / usage:\n\nin yourproject.js\n\n```javascript\nimport { countries, subdivisions } from '@magic/iso-3166'\n\n// both countries and subdivisions are regular js arrays.\n\nconst AfghanistanByName = countries.find(country =\u003e country.name === 'Afghanistan')\n\n/* returns\n{ name: 'Afghanistan', a2: 'AF', a3: 'AFG', num: '004' }\n*/\n\nconst AmericanSamoaByAlphaNumeric2 = countries.find(country =\u003e country.a2 === 'AS')\nconst AustraliaByAlphaNumeric3 = countries.find(country =\u003e country.a3 === 'AUS')\nconst AntarcticaByNumeric = countries.find(country =\u003e country.num === '010')\n\nconst BrasilianSubdivisions = subdivisions.filter(sub =\u003e sub.country === 'BR')\n\nconst AustrianSubdivisions = subdivisons.filter(sub =\u003e sub.country === 'AT')\n\n/* returns\n{ country: 'AT', code: '1', name: 'Burgenland', type: 'state' },\n{ country: 'AT', code: '2', name: 'Kärnten', type: 'state' },\n{ country: 'AT', code: '3', name: 'Niederösterreich', type: 'state' },\n{ country: 'AT', code: '4', name: 'Oberösterreich', type: 'state' },\n{ country: 'AT', code: '5', name: 'Salzburg', type: 'state' },\n{ country: 'AT', code: '6', name: 'Steiermark', type: 'state' },\n{ country: 'AT', code: '7', name: 'Tirol', type: 'state' },\n{ country: 'AT', code: '8', name: 'Vorarlberg', type: 'state' },\n{ country: 'AT', code: '9', name: 'Wien', type: 'state' }\n*/\n```\n\n### changelog\n\n#### 0.0.1\n\nfirst publish\n\n#### 0.0.2 - unreleased\n\n...\n\n[npm-image]: https://img.shields.io/npm/v/@magic/iso-3166.svg\n[npm-url]: https://www.npmjs.com/package/@magic/iso-3166\n[travis-image]: https://img.shields.io/travis/com/magic/iso-3166.svg?branch=master\n[travis-url]: https://travis-ci.com/magic/iso-3166\n[appveyor-image]: https://img.shields.io/appveyor/ci/magic/iso-3166/master.svg\n[appveyor-url]: https://ci.appveyor.com/project/magic/iso-3166/branch/master\n[coveralls-image]: https://coveralls.io/repos/github/magic/iso-3166/badge.svg\n[coveralls-url]: https://coveralls.io/github/magic/iso-3166\n[snyk-image]: https://snyk.io/test/github/magic/iso-3166/badge.svg\n[snyk-url]: https://snyk.io/test/github/magic/iso-3166\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Fiso-3166","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagic%2Fiso-3166","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagic%2Fiso-3166/lists"}