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

digitalpin

v1.1.2

Published

Library for Geospatial Addressing Solution by India Post

Downloads

7

Readme

semantic-release: angular code style: prettier lang: typescript NPM Version NPM Downloads CI

DigiPin

A JavaScript/TypeScript library for India Post's Geospatial Addressing Solution. This library provides methods to encode and decode DigiPins - a 10-character alphanumeric code that represents a unique geographical location in India.

Installation

npm install digipin

Usage

JavaScript

const { getDigiPin, getLatLngFromDigiPin } = require('digipin');

// Convert latitude and longitude to DigiPin
const digiPin = getDigiPin(28.6139, 77.209); // Delhi coordinates
console.log(digiPin); // Returns formatted DigiPin like "ABC-DEF-GHIJ"

// Convert DigiPin back to coordinates
const coordinates = getLatLngFromDigiPin('ABC-DEF-GHIJ');
console.log(coordinates); // { latitude: "28.613900", longitude: "77.209000" }

TypeScript

import { getDigiPin, getLatLngFromDigiPin } from 'digipin';

// Convert latitude and longitude to DigiPin
const digiPin = getDigiPin(28.6139, 77.209); // Delhi coordinates
console.log(digiPin); // Returns formatted DigiPin like "ABC-DEF-GHIJ"

// Convert DigiPin back to coordinates
const coordinates = getLatLngFromDigiPin('ABC-DEF-GHIJ');
console.log(coordinates); // { latitude: "28.613900", longitude: "77.209000" }

API Reference

getDigiPin(lat: number, lon: number): string

Converts latitude and longitude coordinates to a DigiPin.

  • Parameters:
    • lat (number): Latitude value between 2.5 and 38.5
    • lon (number): Longitude value between 63.5 and 99.5
  • Returns: A formatted DigiPin string (e.g., "ABC-DEF-GHIJ")
  • Throws: Error if latitude or longitude is out of range

getLatLngFromDigiPin(digiPin: string): { latitude: string, longitude: string }

Converts a DigiPin back to its corresponding coordinates.

  • Parameters:
    • digiPin (string): A 10-digit DigiPin string (with or without hyphens)
  • Returns: Object containing the decoded latitude and longitude as strings
  • Throws: Error if DigiPin format is invalid

Geographic Coverage

This library works for coordinates within India's geographic bounds:

  • Latitude: 2.5°N to 38.5°N
  • Longitude: 63.5°E to 99.5°E

License

ISC

Author

Amit Kumar