ugaddress

1.0.1 • Public • Published

OPEN UG ADDRESS

ugaddress package helps you access Districts for specific regions in Uganda.

Installation

You can install ugaddress via npm. I can run in any environment and has no dependency.

npm install ugaddress

Usage

ugaddress provides a set of utility functions to fetch interact with the OPEN UG API

getDistricts

This function collects districts for a specific region. It accepts specifically 4 types of paramenters which are the four regions of Uganda:

  • "Northen"
  • "Eastern"
  • "Western"
  • "Central"

Note: This function is asynchronous and returns a promise so use await or chain it using the .then function. The return type is an array of the districts.

import { getDistricts } from "ugaddress";

// When using async code
const districts = await getDistricts("Northen")
console.log(districts)

// When using synchronous code
getDistricts("Northern").then((districts) =>{
  // Do something
})

Package Sidebar

Install

npm i ugaddress

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

2.68 kB

Total Files

4

Last publish

Collaborators

  • jimjunior