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-lga-data

v1.0.0

Published

A TypeScript-first npm package for all 774 Nigerian LGAs — with geopolitical zones, coordinates, and geospatial lookups. The only Nigerian LGA dataset with built-in proximity search.

Readme

nigeria-lga-data

The only TypeScript-first npm package for all 774 Nigerian LGAs — with geopolitical zones, coordinates, and proximity search.

npm version npm downloads license: MIT tests


Why this package?

If you're building health tech, civic tech, NGO tools, or any location-aware app for Nigeria, you need reliable LGA data — not just names.

Existing packages give you a flat list of LGA names. This package gives you:

| Feature | Other packages | nigeria-lga-data | |---|---|---| | LGA names | ✅ | ✅ | | State capitals | ✅ | ✅ | | Geopolitical zones | ❌ | ✅ | | Centroid coordinates | ❌ | ✅ | | Proximity search (nearest LGA by lat/lng) | ❌ | ✅ | | TypeScript-first (full type safety) | ❌ | ✅ | | ESM + CJS support | ❌ | ✅ | | Unique slug IDs | ❌ | ✅ |

Built and maintained by someone who shipped a production disease surveillance dashboard for a Nigerian LGA — and needed this data to do it.


Installation

npm install nigeria-lga-data
# or
yarn add nigeria-lga-data

Quick Start

import {
  getAll,
  getByState,
  getByName,
  getById,
  getByZone,
  getByCoordinates,
  getNearby,
  getStates,
} from "nigeria-lga-data";

// Get all 774 LGAs
const all = getAll();

// Filter by state
const plateauLGAs = getByState("Plateau");
// → [{ id: "plateau-barkin-ladi", name: "Barkin Ladi", state: "Plateau", ... }]

// Look up by name
const langtang = getByName("Langtang North");
// → [{ id: "plateau-langtang-north", geopoliticalZone: "North Central", ... }]

// Stable slug-based lookup
const lga = getById("plateau-langtang-north");

// Filter by geopolitical zone
const northCentral = getByZone("North Central");

// 🌍 Find nearest LGA to a GPS coordinate
const nearest = getByCoordinates(9.8, 9.4);
// → { lga: { name: "Langtang North", ... }, distanceKm: 12.3 }

// Get 5 closest LGAs to a point
const nearby = getNearby(6.45, 3.39, 5); // Near Lagos

API Reference

getAll(): LGA[]

Returns all LGAs in the dataset.

getByState(state: string): LGA[]

Returns all LGAs in a state. Case-insensitive.

getByName(name: string): LGA[]

Finds LGAs by name. Returns all matches (useful for duplicate LGA names across states).

getById(id: string): LGA | undefined

Finds a single LGA by its unique slug ID (e.g. "plateau-langtang-north").

getByZone(zone: GeopoliticalZone): LGA[]

Filters LGAs by geopolitical zone. Valid values: "North Central" | "North East" | "North West" | "South East" | "South South" | "South West"

getByCoordinates(lat: number, lng: number): NearestLGAResult

Returns the LGA with the nearest centroid to the given coordinates, plus the distance in km.

getNearby(lat: number, lng: number, limit?: number): NearestLGAResult[]

Returns the N closest LGAs sorted by distance. Default limit: 5.

getStates(): string[]

Returns all 37 state names (36 states + FCT), sorted alphabetically.

getZones(): GeopoliticalZone[]

Returns all six geopolitical zone names.

getLGACountByState(): Record<string, number>

Returns a map of state → LGA count.


Data Shape

interface LGA {
  id: string;               // "plateau-langtang-north"
  name: string;             // "Langtang North"
  state: string;            // "Plateau"
  geopoliticalZone: GeopoliticalZone; // "North Central"
  coordinates: {
    lat: number;            // 10.0486
    lng: number;            // 8.2019
  };
}

Use Cases

  • Health tech dashboards — map disease data to LGA boundaries
  • NGO & humanitarian tools — aggregate survey responses by zone
  • Civic tech apps — constituency lookups, population mapping
  • Logistics platforms — route planning across administrative areas
  • Government reporting — standardize LGA names across datasets

Roadmap

  • [ ] v1.1 — Add GeoJSON boundary loader (opt-in, lazy-loaded)
  • [ ] v1.2 — Population estimates per LGA
  • [ ] v1.3 — Health facility counts per LGA (GRID3 data)
  • [ ] v2.0 — Ward-level data

Contributions welcome — see CONTRIBUTING.md.


Built in the context of public health

This package was extracted from real-world work on Langtang HealthLink, an open-source disease surveillance and community health dashboard built for Langtang North LGA, Plateau State. It is maintained as a standalone tool so that other developers building health and civic applications for Nigeria can depend on it.


License

MIT — free to use in any project, commercial or otherwise.

If this package saves you time, please ⭐️ the repo and share it with other Nigerian developers.