Socket
Socket
Sign inDemoInstall

iso-3166-1

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    iso-3166-1

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


Version published
Weekly downloads
95K
decreased by-1.24%
Maintainers
1
Install size
38.0 kB
Created
Weekly downloads
 

Readme

Source

iso-3166-1

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

Build Status npm version npm version npm version

Installation

npm install iso-3166-1 --save

Usage

Get country by ISO 3166-1 Alpha-2

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

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

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

const iso = require('iso-3166-1');

console.log(iso.whereCountry('NORWAY'));
/** Returns:
  {
    country: 'Norway',
    alpha2: 'NO',
    alpha3: 'NOR',
    numeric: '578'
  }
*/

Get all countries

const iso = require('iso-3166-1');

console.log(iso.all());
/** Returns:
  [
    {
      country: 'Norway',
      alpha2: 'NO',
      alpha3: 'NOR',
      numeric: '578'
    }
  ]
*/

License

MIT © Daniel Eckermann

Keywords

FAQs

Last updated on 08 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc