Light Weight Package for fetching countries and state
npm install countries-state-lightLight Weight library for Country and State
npm i countries-state-light
It accepts a valid CountryCode eg: 'US' and returns _Country Details_
type: json | ICountry
``js`
{
isoCode: "US",
name: "United States",
phonecode: "1",
flag: "🇺🇸"
}
It accepts a valid StateCode eg: 'CA' CountryCode eg: 'US' and returns _State Details_
type: json | ICountry
`js`
{
name: "California",
isoCode: "CA",
countryCode: "US",
}
It accepts a valid CountryCode and returns _all States_ as Array of JSON
type: array of json | IState
`js`
[
{
name: 'Arizona',
isoCode: 'AZ',
countryCode: 'US',
},
];
It returns all Countries
type: array of json | ICountry
`js`
[
{
isoCode: 'US',
name: 'United States',
phonecode: '1',
flag: '🇺🇸',
},
];
It returns all States
type: array of json | IState
`js``
[
{
name: 'Arizona',
isoCode: 'AZ',
countryCode: 'US',
},
];