https://github.com/ogubuikeAlex/CountryRegionJS
CountryRegionJs is a simple-to-use library that provides you with the MOST COMPREHENSIVE cascading dropdown for loading countries, associated states and substates (local governments).
https://github.com/ogubuikeAlex/CountryRegionJS
api countries countries-api country country-dropdownlist country-state-city-dropdown dropdown javascript location nodejs react reactjs
Last synced: 9 months ago
JSON representation
CountryRegionJs is a simple-to-use library that provides you with the MOST COMPREHENSIVE cascading dropdown for loading countries, associated states and substates (local governments).
- Host: GitHub
- URL: https://github.com/ogubuikeAlex/CountryRegionJS
- Owner: ogubuikeAlex
- License: mit
- Created: 2023-04-21T13:55:45.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-09-21T20:04:40.000Z (over 2 years ago)
- Last Synced: 2025-01-17T21:10:35.250Z (over 1 year ago)
- Topics: api, countries, countries-api, country, country-dropdownlist, country-state-city-dropdown, dropdown, javascript, location, nodejs, react, reactjs
- Language: JavaScript
- Homepage:
- Size: 206 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 5
-
Metadata Files:
- Readme: ReadME.md
- Contributing: contributing.md
- License: LICENSE.md
- Code of conduct: code_of_conduct.md
Awesome Lists containing this project
README

# **CountryRegion**
CountryRegionJs is a simple-to-use library that provides you with **the MOST COMPREHENSIVE** cascading dropdown for loading countries, associated states and substates (local governments).

## **Badges**
[](https://choosealicense.com/licenses/mit/)
stable release version: 
Nuget package downloads: 
NPM downloads: 
## **Tech Stack**
Vanilla Javascript, Jest, Axios
## **How Do I Get Started**
Install `CountryRegionJS` with npm
```bash
npm install CountryRegionJS
```
or with yarn
```javascript
yarn add CountryRegionJS
```
Sample usage:
```javascript
//import countryregionjs
import CountryRegion from "countryregionjs";
const countryRegion = new CountryRegion();
//sample ids
const countryId = 1;
const stateId = 1;
const substateId = 1;
//get all countries
const countries = await countryRegion.getCountries();
//get all statess
const states = await countryRegion.getStates(countryId);
//get all substates
const subStates = await countryRegion.getLGAs(countryId, stateId);
//get a country
const country = await countryRegion.getCountry(countryId);
//get a state
const id = 1;
const country = await countryRegion.getState(countryId, stateId);
//get a sub-state
const id = 1;
const country = await countryRegion.getLga(countryId, stateId, substateId);
```
## **Documentation**
A comprehensive documentation is underway💥
## **Features**
- Get all countries
- Get all states
- Get all local governments
- Get a country
- Get a state
- Get a local government
## **Testing**
To run unit tests:
```shell
npm test
```
## **License**
[MIT](LICENSE) Copyright 2023 OGUBUIKE ALEX
## **Contributing**
Contributions are always welcome!
See `contributing.md` for ways to get started
## **Code Of Conduct**
Please adhere to this project's
[Code of Conduct](code_of_conduct.md) .