JSPM

country-info-list

1.1.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 79
  • Score
    100M100P100Q76917F
  • License ISC

Package Exports

  • country-info-list

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-info-list) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Country info list

Data is sourced from: https://restcountries.eu/rest/v2/all Data is refreshed each night. If there are differences, a new package will be built.

Build at compile time, not at run time

Installation

Install via NPM

npm install country-info-list --save

Include in your project

const countryList = require('country-info-list');
// or
import * as countryList from 'country-info-list';

Usage

getCountries()

Returns all countries with all their data.

getCountry(code)

Returns a country with that code. code can be a 2 or 3 character code.

getNames()

Returns a list of the country names only.

getCodes(?codeType)

Returns a list of the country codes only. codeType is a optional parameter. Valid values: [2, 3]. The number indicates how many characters the country code will have. Defaults to 2.

getCode(name, ?codeType)

Returns a country code for a given country name. codeType is a optional parameter. Valid values: [2, 3]. The number indicates how many characters the country code will have. Defaults to 2.