faraz-countries-states-cities
v1.0.2
Published
# Installation
Downloads
2
Readme
Countries States Cities
Installation
npm i faraz-countries-states-cities
Import in your project file
import {useCountriesStateCities} from 'faraz-countries-states-cities'
or
const {useCountriesStateCities} = require('faraz-countries-states-cities')
Use
const [countries] = useCountryStateCities();
console.log(countries)
Description
This package will give you list of states and cities of countries, basically it will give you JSON and in JSON you will see list of countries with states and cities and with various attributes, like you can see below.
{
"id": 167,
"name": "Pakistan",
"iso3": "PAK",
"iso2": "PK",
"numeric_code": "586",
"phone_code": "92",
"capital": "Islamabad",
"currency": "PKR",
"currency_name": "Pakistani rupee",
"currency_symbol": "₨",
"tld": ".pk",
"native": "Pakistan",
"region": "Asia",
"region_id": "3",
"subregion": "Southern Asia",
"subregion_id": "14",
"nationality": "Pakistani",
"timezones": [
{
"zoneName": "Asia\/Karachi",
"gmtOffset": 18000,
"gmtOffsetName": "UTC+05:00",
"abbreviation": "PKT",
"tzName": "Pakistan Standard Time"
}
],
"translations": {
"kr": "파키스탄",
"pt-BR": "Paquistão",
"pt": "Paquistão",
"nl": "Pakistan",
"hr": "Pakistan",
"fa": "پاکستان",
"de": "Pakistan",
"es": "Pakistán",
"fr": "Pakistan",
"ja": "パキスタン",
"it": "Pakistan",
"cn": "巴基斯坦",
"tr": "Pakistan"
},
"latitude": "30.00000000",
"longitude": "70.00000000",
"emoji": "🇵🇰",
"emojiU": "U+1F1F5 U+1F1F0",
"states": [
{
"id": 3172,
"name": "Azad Kashmir",
"state_code": "JK",
"latitude": "33.92590550",
"longitude": "73.78103340",
"type": null,
"cities": [
{
"id": 85368,
"name": "Bhimbar",
"latitude": "32.97465000",
"longitude": "74.07846000"
},
{
"id": 85562,
"name": "Kotli",
"latitude": "33.51836000",
"longitude": "73.90220000"
},
{
"id": 85563,
"name": "Kotli District",
"latitude": "33.44559000",
"longitude": "73.91557000"
},
{
"id": 85614,
"name": "Mirpur District",
"latitude": "33.21556000",
"longitude": "73.75144000"
},
{
"id": 85628,
"name": "Muzaffarābād",
"latitude": "34.37002000",
"longitude": "73.47082000"
},
{
"id": 85643,
"name": "New Mirpur",
"latitude": "33.14782000",
"longitude": "73.75187000"
},
{
"id": 85682,
"name": "Rawala Kot",
"latitude": "33.85782000",
"longitude": "73.76043000"
}
]
},
]
}