npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

nigeria-states

v0.0.1

Published

Package to get all nigeria states, local governments and their cities

Readme

Nigeria GeoData

Nigeria GeoData is an npm package that provides easy-to-use functions to retrieve Nigerian states, their local government areas (LGAs), and cities/areas within those LGAs. This package is ideal for developers building applications that require geographic data of Nigeria, such as dropdown selectors, data validation, or any location-based feature.

Installation

Install the package using npm:

npm install nigeria-geodata

Or using Yarn:

yarn add nigeria-geodata

Usage

Import the functions in your TypeScript or JavaScript project:

TypeScript Example

import { getAllStates, getLocalGovernments, getCities } from 'nigeria-geodata';

// Get all Nigerian states (alphabetically sorted) const states = getAllStates(); console.log('States:', states);

// Get Local Government Areas for a specific state (case insensitive) const stateName = 'Abia'; const lgas = getLocalGovernments(stateName); console.log(Local Governments in ${stateName}:, lgas);

// Get Cities/Areas for a specific LGA within a state (case insensitive) const localGovernment = 'Aba North'; const cities = getCities(stateName, localGovernment); console.log(Cities/Areas in ${localGovernment}, ${stateName}:, cities);

JavaScript Example

const { getAllStates, getLocalGovernments, getCities } = require('nigeria-geodata');

// Get all Nigerian states const states = getAllStates(); console.log('States:', states);

// Get LGAs for a specific state const stateName = 'Abia'; const lgas = getLocalGovernments(stateName); console.log(Local Governments in ${stateName}:, lgas);

// Get Cities/Areas for a specific LGA in the state const localGovernment = 'Aba North'; const cities = getCities(stateName, localGovernment); console.log(Cities/Areas in ${localGovernment}, ${stateName}:, cities);

API Reference

getAllStates() Returns: string[] Description: Extracts and returns a sorted array of all unique Nigerian state names from the data.

stateName: The name of the state (case insensitive). Returns: string[] Description: Finds the state object matching the given name and returns a sorted array of its local government areas. Returns an empty array if the state is not found.

getCities(stateName: string, localGovernment: string)

getCities(stateName: string, localGovernment: string) Parameters:

stateName: The name of the state (case insensitive). localGovernment: The name of the local government area (case insensitive). Returns: string[] Description: Navigates through the state and local government data to return a sorted array of cities/areas within the specified local government. Returns an empty array if the state or local government is not found.

About the Developer This package was developed by a senior software engineer with extensive experience in building robust and user-friendly software solutions. Passionate about leveraging data to solve real-world challenges, the developer created Nigeria GeoData to simplify the process of integrating Nigerian geographic data into modern web and mobile applications.

For more projects, insights, or to get in touch, visit https://mubarakcancode.vercel.app or GitHub https://github.com/binary-tech001.

Contributing Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.

License

This project is licensed under the MIT License.