Socket
Socket
Sign inDemoInstall

iso-3166-1-alpha-2

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    iso-3166-1-alpha-2

Simple module providing ISO-3166-1-alpha-2 country code to english country name lookup and reverse lookup


Version published
Maintainers
1
Install size
2.08 MB
Created

Readme

Source

#Iso-3155-1-alpha-2

Simple lookup interface for iso country codes to countries and reverse.

The only dependency is mout, so this module works both in node and in the browser(ify).

Installation

npm install iso-3166-1-alpha-2

Usage

var iso3311a2 = require('./iso-3166-1-alpha-2')

// Lookup country by code
console.log iso3311a2.getCountry("DE")    // "Germany"

// Lookup code by country
console.log iso3311a2.getCode("Germany")  // "DE"

// Get array of all country codes
console.log iso3311a2.getCodes()          // ["AF","AX","AL",...]

// Get array of all country names
console.log iso3311a2.getCountries()      // ["Afghanistan","Åland Islands","Albania",...]

// Get Object with code (key) to country (value) mappings
console.log iso3311a2.getData()           // { "AF" : "Afghanistan", .... }

Documentation

Docco annotated source is found here: (docs/index.html)

Keywords

FAQs

Last updated on 30 Mar 2024

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