Skip to content

homescriptone/africa-states

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

africa-states

A list of municipalities in African countries.

issues forks stars license twitter

Installation

First, install the package :

  // using npm
  npm install https://github.com/homescriptone/africa-states
  
  or
  
  // using yarn
  yarn add https://github.com/homescriptone/africa-states

Usage

  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