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

data-de-nepal

v1.0.2

Published

Nepal location dataset containing provinces, districts, municipalities, and wards with TypeScript support.

Readme

data-de-nepal

A toolkit for Nepal location and geographic data.

data-de-nepal provides access to Provinces, Districts, Municipalities, and Wards in Nepal. It includes React hooks, Vue composables, Express API routers, NLP fuzzy searching, and a Geospatial computing engine.


Features

  • Fast Lookups: Data is indexed into TypeScript maps.
  • Bilingual: Support for both English and Nepali formatting.
  • Zero Dependencies: The core package is dependency-free.
  • Ward Coverage: Full mapping down to all 6,743 wards across 753 local levels.
  • Fuzzy NLP Search: Typo-tolerant search for autocomplete boxes.
  • React & Vue Ready: Hooks (useNepalLocation) for UI integration.
  • Centroid Geospatial Engine: Nearest-Neighbor reverse geocoding via built-in municipal centroids.
  • Built-in CLI Tool: Query locations from your terminal.

Installation

npm install data-de-nepal

Core Usage

import { 
  getProvinces, 
  getDistricts, 
  getMunicipalities, 
  getFullAddress,
  reverseGeocode,
  terrainDistance
} from 'data-de-nepal';

// 1. Get all districts in Bagmati Province
const bagmatiDistricts = getDistricts("Bagmati Province");

// 2. Format a human-readable address
const address = getFullAddress(274 /* Kathmandu Metropolitan */, 13 /* Ward */);
console.log(address.formatted); 
// "Kathmandu District, Kathmandu Metropolitan City Ward 13, Bagmati Province"

// 3. Reverse Geocoding (Find a municipality from a coordinate)
const lat = 27.7172;
const lng = 85.3240;
const location = reverseGeocode(lat, lng);
if (location) {
  console.log(location.name); // "Kathmandu Metropolitan City"
}

// 4. Terrain-Aware Routing (3D Haversine)
const distance = terrainDistance(
  27.71, 85.32, // Point A (Kathmandu)
  28.20, 83.98  // Point B (Pokhara)
);
console.log(`Distance: ${distance} km`);

Frontend Frameworks

React

import { useNepalLocation } from 'data-de-nepal/react';

function AddressForm() {
  const { 
    provinces, districts, municipalities, 
    selectedProvinceId, setSelectedProvinceId,
    selectedDistrictId, setSelectedDistrictId
  } = useNepalLocation();

  // Your dropdowns go here...
}

Vue 3

<script setup>
import { useNepalLocation } from 'data-de-nepal/vue';

const { provinces, districts, selectedProvinceId } = useNepalLocation();
</script>

NLP Fuzzy Search

import { searchLocation } from 'data-de-nepal/nlp';

// Handle typo and find Kathmandu
const results = searchLocation("katmandu"); 

Express API Router

import express from 'express';
import { nepalLocationRouter } from 'data-de-nepal/api';

const app = express();

// Exposes endpoints like: GET /api/locations/provinces
app.use('/api/locations', nepalLocationRouter()); 

app.listen(3000);

CLI Tool

Query location hierarchies from your terminal:

npx data-de-nepal info "pokhara"

Found matches for "pokhara":
[MUNICIPALITY] Pokhara Metropolitan City (पोखरा महानगरपालिका)
Hierarchy: Kaski, Gandaki Province

License

MIT License.