vk-country-state-city

1.0.3 • Public • Published

Installation

$ npm i vk-country-state-city

Usage

import {getCountries, getStates, getCities} from "vk-country-state-city"

const main = async () => {
    const countries = await getCountries()
    const country = countries[0].name
    console.log(country) // Eg: [{name:"India",iso2:"IN",iso3:"IND"}]

    const states = await getStates(country)
    const state = states[0].name
    console.log(state) // Eg: [{name:"Kerala",code:"KL"}]

    const cities = await getCities(country, state)
    console.log(cities) // Eg: ["kozhikode"]
}

main()

Readme

Keywords

Package Sidebar

Install

npm i vk-country-state-city

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

36.7 MB

Total Files

6

Last publish

Collaborators

  • thenamevishnu