metro-realtime-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

metro-realtime-client

CircleCI   codecov  

Los Angeles Metro provides a RESTful API to retrieve realtime positions of their bus fleet. This is a low level client that does very little transformation on the responses from the API.

Metro Realtime API Overview

Installation

yarn install metro-realtime-client

Usage

All functions export a Promise that can be used then .then or async/await.

var client = require("metro-realtime-client");
 
// All functions return a Promise...
client
  .listAgencies()
  .then(agencies => {
    // all calls to the client return a promise...
  })
  .catch(err => {
    // ...
  });
 
// ...so async/await works as well
const agencies = await client.listAgencies();
// Multiple entity getters
client.listAgencies();
client.listRoutes("lametro");
client.listStops("lametro");
client.listVehicles("lametro"); // All vehicles for the entire agency
client.listVehicles("lametro", "901"); // All vehicles for a specific route
 
// Single entity getters
client.getAgency("lametro");
client.getRoute("lametro", "901");
client.getStop("lametro", "15436");

Readme

Keywords

none

Package Sidebar

Install

npm i metro-realtime-client

Weekly Downloads

1

Version

1.0.5

License

ISC

Unpacked Size

26.6 kB

Total Files

18

Last publish

Collaborators

  • cmcahoon