virtuele-countries-lib
v1.0.6
Published
Country, State and City utility library
Readme
Virtuele Countries Library
A lightweight JavaScript library to fetch and query country, state, and city data from a CDN JSON.
Installing
Using npm: $ npm install virtuele-countries-lib
Once the package is installed, you can import the library using import or require approach:
import { getCountries, getStates, getCities } from "virtuele-countries-lib"Get Countries
const countries = getCountries();
Example [{ id: 101, name: 'India', phone_code: '+91' }.....]
Get States
const states = getStates(countryId);
Example [{ id: 4026, name: 'Karnataka' }.....]
Get cities
const cities = getCities(countryId, stateId);
Example [{ id: 133053, name: 'Mysuru' }.....]
