countries-with-cities
v1.1.0
Published
All countries of CIS with cities select dropdown
Maintainers
Readme
countries-with-cities
Retrieve all countries of CIS with cities
Features
- Get names, codes and cities of all countries
- Filter cities by country name, country code, continent name
Installing
npm install countries-with-citiesOR
yarn add countries-with-citiesOR
pnpm i countries-with-citiesOnce the package is installed you use the require/import approach
const countriesWithCities = require("countries-with-cities");
OR;
import countriesWithCities from "countries-with-cities";Or with TypeScript
import * as countriesWithCities from "countries-with-cities";create a .d.ts file and add
declare module "countries-with-cities";Get countries
This will list all countries.
const countriesWithCities = require("countries-with-cities");
// To get all countries in array
countriesWithCities.getAllCountries();Get cities
This will retrieve information about countries with code, continent etc. Filter by country name, country code or continent
const countriesWithCities = require("countries-with-cities");
// If withCountries is true, we get object [{Country, City}, {Country, City}]
countriesWithCities.getAllCities(withCountries:bool);License
Happy coding, Star before Fork 😊💪💯

