Kenya counties and sub-counties as json objects
npm install --save kenyacounties
const KenyaCounties = require ('kenyacounties')
let counties = KenyaCounties.getAll()
console.log(counties)
Note: the code should be an intenger ranging from 1 - 47
let Nairobi = KenyaCounties.getCountyByCode(47);
Note: the code should be an intenger ranging from 1 - 47, while the county name should be a string irregardless of cases.
// Name = Nairobi, code = 47
let obj = KenyaCounties.getSubCountiesByCountyCode(47) // returns all the subcounties within Nairobi
let obj = KenyaCounties.getSubCountiesByCountyName("Nairobi") // returns all the subcounties within Nairobi