nigeria-bus-stops
v1.0.1
Published
List of Nigerian Main Areas in all States and LGAs
Maintainers
Readme
nigeria-bus-stops
A dataset of Nigerian bus stops and notable places organized by state and LGA, with TypeScript enums for safe access.
Installation
npm install nigeria-bus-stopsUsage
1. Import the package
If using JavaScript (CommonJS):
const { nigeriaBusStops, States, CrossRiverLGA } = require("nigeria-bus-stops");If using TypeScript or ES Modules:
import { nigeriaBusStops, States, CrossRiverLGA } from "nigeria-bus-stops";2. Accessing Bus Stops
By State and LGA
Use the provided enums for safe and typo-free access:
const stops =
nigeriaBusStops[States.CROSS_RIVER][CrossRiverLGA.CALABAR_MUNICIPAL];
console.log(stops);
// Output: [ 'Calabar', 'Marine Base', 'Ekorinim', 'Henshaw Town', 'Big Qua' ]Example: List all LGAs in a State
const { NigeriaLGAs } = require("nigeria-bus-stops");
console.log(Object.values(NigeriaLGAs[States.LAGOS]));3. TypeScript Support
All enums and data are fully typed for TypeScript users.
import { nigeriaBusStops, States, LagosLGA } from "nigeria-bus-stops";
const stops: string[] = nigeriaBusStops[States.LAGOS][LagosLGA.IKEJA];4. Full Example
const { nigeriaBusStops, States, CrossRiverLGA } = require("nigeria-bus-stops");
console.log(
nigeriaBusStops[States.CROSS_RIVER][CrossRiverLGA.CALABAR_MUNICIPAL]
);
## API
- `nigeriaBusStops`: Main data object, accessed by `[State][LGA]`.
- `States`: Enum of all 36 states + FCT.
- `[State]LGA`: Enum of all LGAs for each state (e.g., `LagosLGA`, `CrossRiverLGA`).
- `NigeriaLGAs`: Object mapping each state to its LGA enum.
## Notes
- Always use the enums for keys to avoid typos.
- The package is compatible with both JavaScript and TypeScript.
## License
MIT