Lookup information with ISO 3166-1 alpha-2, ISO 3166-1 alpha-3 and ISO 3166-1 numeric
npm install iso-3166-1



bash
npm install iso-3166-1 --save
`$3
Get country by ISO 3166-1 Alpha-2
`javascript
const iso = require('iso-3166-1');console.log(iso.whereAlpha2('no'));
/** Returns:
{
country: 'Norway',
alpha2: 'NO',
alpha3: 'NOR',
numeric: '578'
}
*/
`Get country by ISO 3166-1 Alpha-3
`javascript
const iso = require('iso-3166-1');console.log(iso.whereAlpha3('nor'));
/** Returns:
{
country: 'Norway',
alpha2: 'NO',
alpha3: 'NOR',
numeric: '578'
}
*/
`Get country by ISO 3166-1 Numeric
`javascript
const iso = require('iso-3166-1');console.log(iso.whereNumeric(578));
/** Returns:
{
country: 'Norway',
alpha2: 'NO',
alpha3: 'NOR',
numeric: '578'
}
*/
`Get country by country name
`javascript
const iso = require('iso-3166-1');console.log(iso.whereCountry('NORWAY'));
/** Returns:
{
country: 'Norway',
alpha2: 'NO',
alpha3: 'NOR',
numeric: '578'
}
*/
`Get all countries
`javascript
const iso = require('iso-3166-1');console.log(iso.all());
/** Returns:
[
{
country: 'Norway',
alpha2: 'NO',
alpha3: 'NOR',
numeric: '578'
}
]
*/
``