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

1.0.0 • Public • Published

indian_address

It gives list of states, districts on each state and pincode on each district.

Installation

You can install it using npm:

npm install indian_address

Usage

Here's details of how to use indian_address library.

Note: for typescript you can use type as imported like states, districts, pininfo

Getting states list

const {states} = require("indian_address");

console.log(states) 
// output: [ "Gujarat","Haryana", "Himachal Pradesh", "Jammu & Kashmir", ... ]

Getting districts list (for example up)

const {districts} = require("indian_address");

console.log(districts["uttar pradesh"]) 
// output: [ "Meerut", "Bagpat", "Ghaziabad", "Bulandshahr", "Aligarh" ... ]

Getting pincode list (for example up, lucknow)

const {pincodes} = require("indian_address");

// state and district separated by underscore ( _ ) 
// for example state: uttar pradesh and district: lucknow as written bellow
console.log(pincodes["uttar pradesh_lucknow"]) 
// output: [ "226002", "226003", "226016", "226018", "226026", ... ]

Getting pincode list (for example up, lucknow)

const {pininfo} = require("indian_address");

console.log(pininfo["110001"]) 
// output: { "state": "Delhi", "city": "Central Delhi" }

console.log(pininfo["110001"]) 
// output: { "state": "Delhi", "city": "Central Delhi" }

Acknowledgments

This library uses data from https://data.opendatasoft.com/explore/dataset/geonames-postal-code%40public/?sort=-latitude for pincode information.

Contact

If you have any questions or suggestions, please feel free to contact us.
Siddharth Sharma i@sidsharma.in

Package Sidebar

Install

npm i indian_address

Weekly Downloads

10

Version

1.0.0

License

ISC

Unpacked Size

3.41 MB

Total Files

18

Last publish

Collaborators

  • panditsiddharth