JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 120421
  • Score
    100M100P100Q169095F
  • License MIT

Finds countries by various country codes

Package Exports

  • country-code-lookup

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (country-code-lookup) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Build Status

Country Code Lookup

A node.js module to look up countries by various country codes.

Supported codes:

  • FIPS 10-4 codes (2 digits)
  • ISO 3166 (2 digits)
  • ISO 3166 (3 digits)
  • ISO 3166 (numbers)
  • Internet codes

Installation

$ npm install country-code-lookup

Usage

var lookup = require('country-code-lookup');

// search by FIPS
lookup.byFips('UK');

// search by ISO
lookpup.byIso('GB');
lookpup.byIso('GBR');
lookpup.byIso(826);

// search by internet code
lookpup.byInternet('UK');

// get an array of all countries
lookup.countries

Searching for a country will return either null, or a country object:

{ continent: 'Europe',
  region: 'Western Europe',
  country: 'United Kingdom',
  capital: 'London',
  fips: 'UK',
  iso2: 'GB',
  iso3: 'GBR',
  isoNo: '826',
  internet: 'UK' }

License

MIT