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

metro-route-sdk

v0.1.1

Published

Official JavaScript/TypeScript SDK for the Metro Route Premium API.

Readme

Metro Route SDK (JavaScript)

NPM version

The official, strongly-typed JavaScript client library for the Metro Route Premium API. This SDK provides seamless, programmatic access to real-time data, station information, and journey planning for both the Delhi Metro (DMRC) and the Noida Metro (NMRC).

Built on top of the native fetch API, this SDK has zero external dependencies and works flawlessly across:

  • Node.js (18+)
  • Modern Web Browsers
  • React Native / Expo
  • Cloudflare Workers & Edge environments

🚀 Installation

npm install metro-route-sdk

💻 Quick Start

import { MetroRouteClient } from 'metro-route-sdk';

const client = new MetroRouteClient();

async function main() {
    // Plan a Delhi Metro journey
    const dmrcJourney = await client.planJourney("RG", "DW21");
    console.log(`DMRC Fare: ₹${dmrcJourney.fare}`);

    // Plan a Noida Metro journey
    const nmrcJourney = await client.planNmrcJourney("1", "16");
    console.log(`NMRC Fare: ₹${nmrcJourney.fare}`);
}

main();

📚 Full API Reference

The MetroRouteClient fully utilizes Promises and maps directly to the API routes.

🚆 Delhi Metro (DMRC) Endpoints

1. getLines()

Fetches a list of all currently operating Delhi Metro lines, including their hex colors and terminal stations.

  • Returns: Promise<Array<Object>>

2. getStationsByLine(lineCode)

Retrieves every station on a specific line sequentially.

  • Parameters:
    • lineCode (string): The identifier for the line (e.g., "YELLOW", "BLUE").
  • Returns: Promise<Array<Object>>

3. searchStations(name)

Fuzzy-searches for stations matching the given name query.

  • Parameters:
    • name (string): Search term (e.g., "Rajiv").
  • Returns: Promise<Array<Object>>

4. getStationDetails(stationCode)

Retrieves comprehensive details about a specific station, including gates, platforms, and interchange information.

  • Parameters:
    • stationCode (string): The station's unique code (e.g., "RG" for Rajiv Chowk).
  • Returns: Promise<Object>

5. planJourney(fromStationCode, toStationCode)

Calculates the optimal route between two DMRC stations, providing the exact fare, travel time, and a step-by-step path including interchanges.

  • Parameters:
    • fromStationCode (string): Starting station code.
    • toStationCode (string): Destination station code.
  • Returns: Promise<Object>

6. getNotifications()

Fetches the latest official alerts, delays, and notifications directly from DMRC.

  • Returns: Promise<Array<Object>>

🚊 Noida Metro (NMRC) Endpoints

7. getNmrcStations()

Fetches all operational stations on the Noida Metro Aqua Line.

  • Returns: Promise<Array<Object>>

8. planNmrcJourney(fromStationId, toStationId)

Calculates the fare and route for a journey entirely within the Aqua Line network.

  • Parameters:
    • fromStationId (string): Numeric string ID of the starting station (e.g., "1" for Sector 51).
    • toStationId (string): Numeric string ID of the destination station.
  • Returns: Promise<Object>

⚙️ Configuration

By default, the client points to the live production server. You can override the baseUrl during initialization if you are hosting the API yourself:

const localClient = new MetroRouteClient("http://localhost:8000/api/v2");