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

sri-lanka-transit-data

v0.1.0

Published

Sri Lanka inter-provincial bus routes and official NTC fares as typed, zero-dependency data for JavaScript and TypeScript.

Readme

sri-lanka-transit-data

Sri Lanka inter-provincial bus routes and official fares, as typed, zero-dependency data for JavaScript and TypeScript.

The dataset is extracted from the National Transport Commission (NTC) route-wise full bus fare publication by the open-source sri-lanka-transit-data data pipeline, and bundled here so any Node.js or browser-adjacent project can query it without scraping PDFs.

Unofficial community package. Data is compiled from official NTC publications and every record keeps its source URL, but this package is not published or endorsed by the NTC. Verify fares against the official source before relying on them commercially.

Install

npm install sri-lanka-transit-data

Quick start

import { getRouteByNumber, searchRoutes, getFare, dataset } from "sri-lanka-transit-data";

const route = getRouteByNumber("1");
route?.fares.normal; // 521  (full-route fare in LKR)
route?.fares.luxury; // 1018

getFare("1-1", "luxury"); // null: that class is not published for this route

dataset.recordCount; // 433
dataset.originCount; // 69
dataset.destinationCount; // 191

Place names use the official source spelling (Sinhala), so search with the same spelling:

const matches = searchRoutes({ destination: route.destination });

API

| Function | Returns | |---|---| | getAllRoutes() | All TransitRoute records | | getRouteByNumber(routeNumber) | One route, or undefined | | searchRoutes({ origin?, destination?, routeNumber? }) | Routes matching all given filters (substring, case-insensitive; route number exact) | | getOrigins() / getDestinations() | Sorted distinct place names | | getFare(routeNumber, serviceClass) | Fare in LKR, null if that class is not published, undefined if the route does not exist | | dataset | Metadata: record counts, source name and source URLs |

serviceClass is one of "normal", "semiLuxury", "luxury".

Data notes

  • 433 inter-provincial routes from the NTC fare publication linked as current in July 2026.
  • Normal fare is published for all 433 routes; semi-luxury for 133 and luxury/AC for 97. Missing classes return null, never a guess.
  • Fares are full-route fares in LKR. Stop-level and fare-stage data are not in this release.
  • Every record carries sourceName and sourceUrl for provenance.

Updating the data

The Python pipeline in the data repository is the source of truth. When the NTC publishes a new fare revision:

SLTD_REPO=/path/to/sri-lanka-transit-data npm run sync-data
npm test && npm run build

Roadmap

  • Stop sequences and fare stages
  • English place-name aliases alongside the official Sinhala spellings
  • GTFS export in the data repository

Licence

Code: MIT. Data: compiled from official National Transport Commission publications; see the data repository's DATA_POLICY.md for the sourcing and personal-data rules applied during extraction.