Skip to content

A package to list all countries by a specific language (English, French, and Arabic), and also list cities by a country and a specific language.

License

Notifications You must be signed in to change notification settings

aerragha/country-city-multilanguage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

country-city-multilanguage

A package to list all countries by a specific language (English, French, and Arabic), and also list cities by a country and a specific language.

Install

  npm install country-city-multilanguage

Get countries

To load the list of all countries use the getCountries function, this function takes 1 param lang

param Type options
lang string "en", "fr", "ar"

Example

const { getCountries } = require("country-city-multilanguage");

const countriesList = getCountries("fr");

console.log(countriesList);

Get cities

To load the list of all cities of an selected country use the getCities function, this function takes 2 params country_index & lang

param Type options
country_index number the index of country selected from the array retuend from the getCountries function
lang string "en", "fr", "ar"

Example

const { getCountries, getCities } = require("country-city-multilanguage");

const countriesList = getCountries("ar");

const citiesList = getCities(countriesList[0].index, "ar");

console.log(citiesList);

About

A package to list all countries by a specific language (English, French, and Arabic), and also list cities by a country and a specific language.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published