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

@stiava/cta

v1.0.5

Published

A NodeJS package for interacting with the CTA Bus and Train apis

Readme

@stiava/cta - Chicago Transit Application SDK

A modern TypeScript client for the Chicago Transit Authority (CTA) Bus Tracker and Train Tracker APIs.

Designed for Node.js, Next.js, and modern JavaScript applications, this package provides a simple, strongly typed interface for accessing real-time CTA transit data.


Key Features

  • 🚌 CTA Bus Tracker client
  • 🚆 CTA Train Tracker client
  • 📍 CTA systems routes, map files, and stops
  • 🚲 Divvy stations data and realtime rack counts.
  • 🚘 Guide to Chicago roads. Interstates, primary roads, awkward turns, and one-way neighborhoods.
  • 🅿️ Chicago Parking Guide: Paid streets, residential permits, and enforcement data(ProPublica).
  • 📝 Full TypeScript support
  • 🌐 Works in Node.js and modern web frameworks

Installation

npm install @stiava/cta

Getting Started

import { CTA } from "@stiava/cta";

// Use the CTA apis.
const cta_buses = new CTABusService(process.env.CTA_BUS_API_KEY!);
const cta_trains = new CTATrainService(process.env.CTA_TRAIN_API_KEY!);




Train Arrivals

const arrivals = await cta.train.getArrivals({
  stationId: "40380",
});

console.log(arrivals);

Bus Arrivals

const arrivals = await cta.bus.getPredictions({
  stopId: "14787",
});

console.log(arrivals);

Find Stops

const stops = await cta.bus.getStops({
  route: "22",
});

Find Train Stations

const stations = await cta.train.getStations();

API Keys

The CTA APIs require developer API keys.

You can request free API keys from the Chicago Transit Authority Developer Center.

Once obtained, provide your keys when creating the client.


TypeScript

This package is written entirely in TypeScript and ships with complete type definitions.

import type {
  TrainArrival,
  BusPrediction,
} from "@jeremystiava/cta";

Framework Support

Works with:

  • Node.js
  • Next.js
  • React
  • Express
  • NestJS
  • Bun
  • Deno (via npm compatibility)

Roadmap

  • [ ] Route planning
  • [ ] Service alerts
  • [ ] Vehicle tracking
  • [ ] GTFS static data helpers
  • [ ] Automatic retry/backoff
  • [ ] Built-in caching
  • [ ] Rate limit handling

Contributing

Contributions, issues, and feature requests are welcome.

If you'd like to contribute, please open an issue or submit a pull request.


License

MIT © Jeremy Stiava