@magic/iso-3166
Exports an array of the iso-3166-1 countrycodes and iso-3166-2 subdivisions.
State of January of 2022
html-docs

installation
be in a nodejs project
npm install --save-exact @magic/iso-3166
import / usage:
in yourproject.js
import { countries, subdivisions } from '@magic/iso-3166'
const AfghanistanByName = countries.find(country => country.name === 'Afghanistan')
const AmericanSamoaByAlphaNumeric2 = countries.find(country => country.a2 === 'AS')
const AustraliaByAlphaNumeric3 = countries.find(country => country.a3 === 'AUS')
const AntarcticaByNumeric = countries.find(country => country.num === '010')
const BrasilianSubdivisions = subdivisions.filter(sub => sub.country === 'BR')
const AustrianSubdivisions = subdivisons.filter(sub => sub.country === 'AT')
changelog
0.0.1
first publish
0.0.2
- add full list of countries to docs
- update dependencies
0.0.3
0.0.4 - unreleased
...