https://github.com/homescriptone/africa-states
A list of Africa States
https://github.com/homescriptone/africa-states
Last synced: 4 months ago
JSON representation
A list of Africa States
- Host: GitHub
- URL: https://github.com/homescriptone/africa-states
- Owner: homescriptone
- License: apache-2.0
- Created: 2021-10-29T11:42:39.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-20T09:42:22.000Z (over 4 years ago)
- Last Synced: 2025-02-13T15:13:04.203Z (about 1 year ago)
- Language: JavaScript
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# africa-states
A list of municipalities in African countries.
[](https://github.com/homescriptone/africa-states)
[](https://github.com/homescriptone/africa-states)
[](https://github.com/homescriptone/africa-states)
[](https://github.com/homescriptone/africa-states)
[](https://twitter.com/intent/tweet?text=Wow:&url=https%3A%2F%2Fgithub.com%2Fhomescriptone%2Fafrica-states)
## Installation
First, install the package :
```sh
// using npm
npm install https://github.com/homescriptone/africa-states
or
// using yarn
yarn add https://github.com/homescriptone/africa-states
```
## Usage
```js
import StateManager from '@homescriptone/africa-states'
//Instantiate the StateManager
const state_obj = new StateManager();
//Get all states
let all_states = state_obj.get_all_states();
//Get state from a specific country
let benin_states = state_obj.get_state('BJ');
let togo_states = state_obj.get_state('TG');
```
## List of states names accepted
| Country | Short Identifier |
|------------------ |------------------ |
| 🇧🇯 Benin | BJ |
| 🇹🇬 Togo | TG |
| 🇨🇮 Cote d'Ivoire | CI |
| 🇧🇫 Burkina-Faso | BF |
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Feel free to add states of your country by following the format already defined.
Please make sure to update tests as appropriate.
## License
[Apache](http://www.apache.org/licenses/)