indian-pincodes
v1.1.0
Published
A package to handle Indian pincodes
Downloads
128
Maintainers
Readme
Indian Pincodes
A comprehensive NPM package to handle Indian pincodes, including details like district, state, region, and more. This package allows you to perform efficient searches and retrieve detailed information about pincodes.
Features
- Get details of a specific pincode
- Get all pincodes in a district
- Get all pincodes in a state
- List all districts in a state
- List all states
- Search pincodes by name, district, or state
- Export the entire list of pincodes
Installation
Install the package using npm:
npm install indian-pincodes
Usage
Import the Package
const pincodes = require('indian-pincodes');
Get Details of a Specific Pincode
const details = pincodes.getPincodeDetails(481335);
console.log(details);
Get All Pincodes in a District
const districtPincodes = pincodes.getPincodesByDistrict('Balaghat');
console.log(districtPincodes);
Get All Pincodes in a State
const statePincodes = pincodes.getPincodesByState('Madhya Pradesh');
console.log(statePincodes);
List All Districts in a State
const districts = pincodes.getDistrictsByState('Madhya Pradesh');
console.log(districts);
List All States
const states = pincodes.getStates();
console.log(states);
Search Pincodes by Name, District, or State
const searchResults = pincodes.searchPincodes('Bhopal');
console.log(searchResults);
Export the Entire List of Pincodes
const allPincodes = pincodes.getAllPincodes();
console.log(allPincodes);
Contributing
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
License
This project is licensed under the MIT License.