1.2.1 ā€¢ Published 3 years ago

get-my-citiess v1.2.1

Weekly downloads
56
License
-
Repository
github
Last release
3 years ago

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);
}
1.2.1

3 years ago

1.2.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago