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

pincode-address

v1.0.2

Published

Fetch Indian location details using a 6-digit PIN code via India Post's public API.

Readme

📦 Pincode-address

Fetch Indian location details using a 6-digit PIN code via India Post's public API.

🌐 Description

pincode-address is a lightweight Node.js module that uses India Post’s public API to fetch detailed address information such as post office name, district, state, and region, based on the provided PIN code.


🔍 Live Demo

You can try the package in action through a live demo:

🌐 https://pincode-address.netlify.app

The demo page allows users to:

  • Enter a 6-digit Indian PIN code
  • Instantly fetch and display:
    • Post Office Names
    • Branch Types
    • Delivery Status
    • District, State, Region, and more
  • Validate PIN code input before fetching
  • View results in a user-friendly format

Built using React.js, this web interface showcases the functionality of the pincode-address Node.js module in real-time.


🚀 Installation

npm install pincode-address

📚 Usage

const { getPincodeInfo } = require('pincode-address');

(async () => {
  const info = await getPincodeInfo('302022');
  console.log(info);
})();

✅ Output:

[
  {
    "Name": "Bilwa",
    "Description": null,
    "BranchType": "Branch Post Office",
    "DeliveryStatus": "Delivery",
    "Circle": "Rajasthan",
    "District": "Jaipur",
    "Division": "Jaipur City",
    "Region": "Jaipur HQ",
    "Block": "Sanganer",
    "State": "Rajasthan",
    "Country": "India",
    "Pincode": "302022"
  },
  {
    "Name": "Shri Ram Ki Nangal",
    "Description": null,
    "BranchType": "Branch Post Office",
    "DeliveryStatus": "Delivery",
    "Circle": "Rajasthan",
    "District": "Jaipur",
    "Division": "Jaipur City",
    "Region": "Jaipur HQ",
    "Block": "Jaipur",
    "State": "Rajasthan",
    "Country": "India",
    "Pincode": "302022"
  },
  {
    "Name": "Sitapura Industrial Area",
    "Description": null,
    "BranchType": "Sub Post Office",
    "DeliveryStatus": "Delivery",
    "Circle": "Rajasthan",
    "District": "Jaipur",
    "Division": "Jaipur City",
    "Region": "Jaipur HQ",
    "Block": "Jaipur",
    "State": "Rajasthan",
    "Country": "India",
    "Pincode": "302022"
  }
]

🧪 Input Validation

The input must be a 6-digit Indian PIN code, otherwise an error is thrown.

await getPincodeInfo("123"); // ❌ Error: Invalid PIN code. It must be 6 digits.

📦 API Reference

getPincodeInfo(pincode: string): Promise<PostOffice[] | null>

  • pincode - a valid 6-digit string
  • returns - an array of post office objects or null if not found

📄 License

MIT


👤 Author

Roshan Suthar
GitHub: Roshansuthar1105


🛠️ Contributing

Pull requests are welcome. For major changes, open an issue first to discuss what you would like to change.


🐛 Issues

If you encounter any issues or bugs, please report them here.