Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

geo-ng

Ayobamiu70ISC1.0.5TypeScript support: included

Retrieve a comprehensive list of states, areas, and sub-areas in Nigeria, providing users with essential geographic information for the country.

Nigeria, States, Areas, Sub-areas, Geography, Location, Nigerian, states, Nigerian, areas, Nigerian, sub-areas, Geo, data, Geo, information, Local Government, Nodejs, Capital, City, Lga, Local-government

readme

geo-ng

geo-ng is an npm package that provides data related to geographic locations in Nigeria.

Installation

You can install geo-ng via npm or yarn:

npm install geo-ng

or

yarn add geo-ng

Usage

Get List of Nigerian States

import { getNigeriaStates } from 'geo-ng';

const nigeriaStates = getNigeriaStates();
console.log(nigeriaStates);

Get Local Government Areas (LGAs) of a State

import { getLGAs } from 'geo-ng';

const lgas = getLGAs('AB');
console.log(lgas);

Get Areas/Sub-Areas of an LGA

import { getLgaSubAreas } from 'geo-ng';

const subAreas = getLgaSubAreas("AB", "ABA NORTH");
console.log(subAreas);

API

The geo-ng package provides the following API:

  • getNigeriaStates(): Returns a list of Nigerian states with their codes.
  • getLGAs(stateCode: string): Returns the Local Government Areas (LGAs) of a specified state.
  • getLgaSubAreas(stateCode: string, lga: string): Returns the areas/sub-areas of a specified LGA.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

Attribution

The states, local government areas (LGAs), and sub-areas data in this package are sourced from https://govote.ng/, a website providing information related to geographic locations in Nigeria. This data was used to update and enhance the geographic data in the geo-ng package. Visit https://govote.ng/ for more details.