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

sl-gnd-dsd-districts

v1.0.0

Published

Complete Sri Lanka administrative divisions data — Districts (25), Divisional Secretariat Divisions (DSDs ~332), and Grama Niladhari Divisions (GNDs ~14,000+) with search and lookup utilities. Trilingual support (English, Sinhala, Tamil).

Readme

sl-gnd-dsd-districts

Complete Sri Lanka administrative divisions data with search and lookup utilities.

  • 🏛️ 25 Districts — Trilingual names (English, සිංහල, தமிழ்)
  • 🗺️ 332 DSDs — Divisional Secretariat Divisions
  • 📍 14,000+ GNDs — Grama Niladhari Divisions
  • 🔍 Search & Filter — Find by name, district, or province
  • 📦 TypeScript — Full type definitions included
  • Dual Format — Works with ESM & CommonJS

Installation

npm install sl-gnd-dsd-districts

Quick Start

import {
  getDistricts,
  getDSDsByDistrict,
  getGNDsByDistrict,
  searchGND,
  getDistrictByName,
  getStats,
} from "sl-gnd-dsd-districts";

// Get all districts
const allDistricts = getDistricts();
console.log(allDistricts.length); // 25

// Find a district (supports Sinhala & Tamil too!)
const colombo = getDistrictByName("Colombo");
console.log(colombo?.nameSi); // "කොළඹ"
console.log(colombo?.nameTa); // "கொழும்பு"

// Get DSDs in a district
const colomboDSDs = getDSDsByDistrict("Colombo");
console.log(colomboDSDs.length); // 13

// Get GNDs in a district
const colomboGNDs = getGNDsByDistrict("Colombo");
console.log(colomboGNDs.length); // 500+

// Search GNDs by name
const results = searchGND("Malabe");
console.log(results);
// [
//   { fid: 94, name: "Malabe North", district: "Colombo" },
//   { fid: 105, name: "Malabe East", district: "Colombo" },
//   { fid: 106, name: "Malabe West", district: "Colombo" }
// ]

// Overall stats
console.log(getStats());
// { provinces: 9, districts: 25, dsds: 332, gnds: 14022 }

API Reference

Raw Data

| Export | Type | Description | |--------|------|-------------| | districts | District[] | All 25 districts | | dsds | DSD[] | All DSDs | | gnds | GND[] | All GNDs | | PROVINCES | readonly string[] | 9 province names |

District Functions

| Function | Returns | Description | |----------|---------|-------------| | getDistricts() | District[] | All 25 districts | | getDistrictByName(name) | District \| undefined | Find by name (EN/SI/TA) | | getDistrictsByProvince(province) | District[] | Filter by province | | searchDistricts(query) | District[] | Partial name search |

DSD Functions

| Function | Returns | Description | |----------|---------|-------------| | getDSDs() | DSD[] | All DSDs | | getDSDsByDistrict(district) | DSD[] | Filter by district | | getDSDsByProvince(province) | DSD[] | Filter by province | | getDSDByName(name) | DSD \| undefined | Find by exact name | | searchDSD(query) | DSD[] | Partial name search |

GND Functions

| Function | Returns | Description | |----------|---------|-------------| | getGNDs() | GND[] | All GNDs | | getGNDsByDistrict(district) | GND[] | Filter by district | | getGNDByName(name) | GND \| undefined | Find by exact name | | searchGND(query) | GND[] | Partial name search | | getGNDsGroupedByDistrict() | Record<string, GND[]> | Grouped by district |

Cross-Level Functions

| Function | Returns | Description | |----------|---------|-------------| | getDistrictHierarchy(name) | { district, dsds, gndCount } | Full hierarchy lookup | | getStats() | { provinces, districts, dsds, gnds } | Summary counts | | getProvinces() | readonly string[] | All 9 province names |

Types

interface District {
  id: number;
  nameEn: string;    // "Colombo"
  nameSi: string;    // "කොළඹ"
  nameTa: string;    // "கொழும்பு"
  provinceEn: string; // "Western"
  provinceSi: string; // "බස්නාහිර"
  provinceTa: string; // "மேல்"
}

interface DSD {
  fid: number;
  name: string;      // "Kaduwela"
  district: string;  // "Colombo"
  province: string;  // "Western"
}

interface GND {
  fid: number;
  name: string;      // "Malabe North"
  district: string;  // "Colombo"
}

CommonJS Usage

const { getDistricts, searchGND } = require("sl-gnd-dsd-districts");

const districts = getDistricts();
const results = searchGND("Kandy");

License

MIT