Skip to content

wandrew8/countries

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Countries-getter NPM Package

Installation

npm i countries-getter --save

Available Functions

  1. getCodeByName(nameOfCountry) Returns an array of country codes for the country specified Ex. getCodeByName("Cambodia") // ["KH", "KHM"]

  2. getNameByCode(countryCode) Returns the name of the country given the alpha-2 or alpha-3 country code Ex. getNameByCode("KH" || "KHM") // "Cambodia"

How to use

const countriesGetter = require("countries-getter")

const countryCode = countriesGetter.getNameByCode("KH"); console.log(countryCode);

const countryName = countriesGetter.getCodeByName("Cambodia"); console.log(countryName);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published