@cloudparker/easy-country-state-data
v1.1.0
Published
Library to provide country's States Name , _id and countryId
Downloads
5
Readme
easy-countrydata
Library to provide country's name, _id and countryId
Install
npm i @cloudparker/easy-country-state-data --save-dev
CDN install
<script src="https://cdn.jsdelivr.net/gh/paramanandapradhan/easy-country-state-data@main/dist/index.js" />
Usage
Nodejs
import EasyCountryStateData from "@cloudparker/[email protected]";
EasyCountryStateData.getStates();
// Get list of states of all countries
// [ { _id: "US:AK", name: "Alaska", countyId: "US" }, ... , { _id: "IN:AP", name: "Andhra Pradesh",countryId: "IN" }, ... ]
EasyCountryStateData.getStates('IN');
// Get list of states of India
// [ { _id: "IN:AP", name: "Andhra Pradesh",countryId: "IN" }, ... ]
Browser
<script src="https://cdn.jsdelivr.net/gh/paramanandapradhan/easy-country-state-data@main/dist/index.js" />
EasyCountryStateData.getStates();
// Get list of states of all countries
// [ { _id: "US:AK", name: "Alaska", countyId: "US" }, ... , { _id: "IN:AP", name: "Andhra Pradesh",countryId: "IN" }, ... ]
EasyCountryStateData.getStates('IN');
// Get list of states of India
// [ { _id: "IN:AP", name: "Andhra Pradesh",countryId: "IN" }, ... ]