zipcode-ng
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

Nigerian Zip Codes (zipcode-ng)

The zipcode-ng library provides information about states, local government areas (LGAs) towns and zip codes in Nigeria.

Installation

You can install the package via npm:

npm install zipcode-ng

Usage

Importing

import { get_state_data, get_all_state_data } from 'zipcode-ng';

// Retrieve data for a specific state
const lagosStateData = get_state_data('Lagos');
console.log('Lagos State Data:', lagosStateData);

// Retrieve data for all states
const allStatesData = get_all_state_data();
console.log('All States Data:', allStatesData);

Functions

  • get_state_data(identifier: string | StateName) -> StateInfo: Returns information about a specific state based on its name or postal code.

  • get_all_state_data() -> StateInfo[]: Returns information about all states in Nigeria.

Type Definitions

  • StateInfo: Represents the data structure for information about a state, including its name, language, tribe, description, region, etc.

  • StateName: Literal type representing the names of Nigerian states.

JSON Data

The state information returned by the library is sourced from a JSON file included with the package. The JSON file contains details about each state, including local government areas and towns within them.

Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request with your changes.

GitHub Repository

You can find the source code and contribute to this project on GitHub: Nigerian Zip Codes (zipcode-ng) on GitHub

Package Sidebar

Install

npm i zipcode-ng

Weekly Downloads

1

Version

0.0.7

License

MIT

Unpacked Size

28.7 kB

Total Files

5

Last publish

Collaborators

  • awesome_goodman