1.0.5 • Published 5 years ago

metro-realtime-client v1.0.5

Weekly downloads
13
License
ISC
Repository
github
Last release
5 years ago

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");
1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.1

7 years ago

0.1.0

7 years ago