get-my-citiess
TypeScript icon, indicating that this package has built-in type declarations

1.2.1 • Public • Published

Get My Cities

Created this as a place so that others are welcome to contribute with their own cities to this library. Ultimately making it a library with city names of most countries at our disposal whenever we need. Whats special here is that I aim to store city names in their own native characters as well as in English.

Status

Currently I have only added cities in following countries. But they are not fully completed I still need to work on them as well. 🇱🇰 🇹🇼

Features

For now this only have two functions available. One to retrieve cities by giving its country_code and pick one city using its id and relevant country_code.

Getting Started

Prerequisites

node: >= v8.3

Installing

Using npm

npm install --save get-my-citiess
npm i get-my-citiess

Using Yarn

yarn add get-my-citiess

Example Usage

// getting available cities according to a country code and locale given
import { readCities } from 'get-my-citiess';

const getAllCities = async () => {
    const listOfCities = await readCities('LK', 'en'); // to get thaiwan cities in chinese `readCities('TW', 'zh')
}

// getting a particular city by giving country code, locale and its Id
import { getACity, } from 'get-my-citiess';

const getThatCity = async (id) => {
    const listOfCities = await getACity('LK', 'en', 5);
}

// getting districts for a city when districts are divided according to cities
const getDistrictsForCity = async (id) => {
    const districts = await getCitysDistricts('TW', 'en', 2);
}

// getting rezones for a city when available
const getRezones = async (id) => {
    const districts = await getRezoneList('TW', 'en', 2);
}

Package Sidebar

Install

npm i get-my-citiess

Weekly Downloads

0

Version

1.2.1

License

none

Unpacked Size

73 kB

Total Files

12

Last publish

Collaborators

  • z3us94