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

indiapost

v1.0.0

Published

DIGIPIN encoder/decoder CLI and library for India Post

Downloads

5

Readme

DIGIPIN API by Department of Posts

A Geospatial Addressing Solution by India Post

DIGIPIN (Digital PIN) is a 10-character alphanumeric geocode developed by the Department of Posts, India. It provides a precise, user-friendly way to encode geographic coordinates that can be easily shared and decoded back to latitude/longitude pairs.

This open-source Node.js project exposes a public API to generate and decode DIGIPINs, supporting geolocation services, postal logistics, and spatial analysis applications.

License Node.js Express


🏛️ About DIGIPIN

The Department of Posts has undertaken an initiative to establish a Digital Public Infrastructure (DPI) for a standardized, geo-coded addressing system in India. DIGIPIN represents the foundation layer of this infrastructure.

Developed in collaboration with IIT Hyderabad and NRSC (National Remote Sensing Centre, ISRO), DIGIPIN is an open-source national-level addressing grid that serves as a key component of India's digital address ecosystem.

After extensive public consultation and expert review, the DIGIPIN Grid has been finalized to provide simplified addressing solutions for seamless delivery of public and private services, enabling "Address as a Service" (AaaS) across the country.

Key Highlights

  • Uniform Referencing Framework: Provides logical, precise location identification both offline and online
  • GIS Integration: Bridges the gap between physical and digital addresses
  • Cross-Sector Support: Enhances service delivery across emergency response, e-commerce, logistics, BFSI, and governance
  • Policy Alignment: Complies with the National Geospatial Policy 2022, enriching India's geospatial knowledge stack

DIGIPIN simplifies address management and enhances service delivery accuracy, promoting a thriving geospatial ecosystem for India's digital economy.


✨ Features

  • Encode: Convert latitude and longitude into a compact 10-character DIGIPIN
  • Decode: Transform a DIGIPIN back to its center-point coordinates
  • Lightweight: Optimized for performance and minimal resource usage
  • RESTful API: Clean, standard-compliant endpoints
  • Interactive Documentation: Comprehensive Swagger UI for easy exploration
  • Production-Ready: Built with Node.js and Express for reliability


📦 Installation & Usage

Option 1: Use as NPM Package (Recommended)

Install Globally (CLI Usage)

npm install -g digi-pin

CLI Commands:

# Encode coordinates to DIGIPIN
digipin encode 28.6139 77.2090
# Output: FFF-3MF-34F8

# Decode DIGIPIN to coordinates
digipin decode FFF-3MF-34F8
# Output: Latitude: 28.613900, Longitude: 77.209000

Install Locally (Library Usage)

npm install digi-pin

JavaScript Code:

const { getDigiPin, getLatLngFromDigiPin } = require('digi-pin');

// Encode
const pin = getDigiPin(28.6139, 77.2090);
console.log(pin); // FFF-3MF-34F8

// Decode
const coords = getLatLngFromDigiPin('FFF-3MF-34F8');
console.log(coords); // { latitude: '28.613900', longitude: '77.209000' }

Option 2: Use Public API

Access our hosted API at: https://your-render-url.onrender.com

Endpoints:

# Encode
curl "https://your-render-url.onrender.com/api/digipin/encode?latitude=28.6139&longitude=77.2090"

# Decode
curl "https://your-render-url.onrender.com/api/digipin/decode?digipin=FFF-3MF-34F8"

Interactive docs: https://your-render-url.onrender.com/api-docs

Option 3: Self-Host the API

Clone and run your own instance:

git clone https://github.com/divyanshpandey/digipin.git
cd digipin
npm install
npm start