Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 4 days 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 (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-21T20:04:40.000Z (about 1 year ago)
- Last Synced: 2024-11-12T19:49:33.509Z (6 days 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 A cascading dropdown for loading countries and associated states and local governments.](https://raw.githubusercontent.com/Slimcent/CountryRegion/master/images/CountryRegion.png)
# **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).![image](https://github.com/king-Alex-d-great/CountryRegionJS/assets/58665121/502b3627-e828-4871-8a9e-92f17f4ff6b5)
## **Badges**
[![MIT License](https://img.shields.io/badge/License-MIT-green.svg)](https://choosealicense.com/licenses/mit/)
stable release version: ![version](https://img.shields.io/badge/version-1.1.4-blue)
Nuget package downloads: ![downloads](https://img.shields.io/badge/downloads-~5k-yellow)
NPM downloads: ![downloads](https://img.shields.io/badge/downloads-400+-brightgreen)
## **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) .