Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

right-track-transit

1.1.1 • Public • Published

Right Track Transit Agency (Abstract)

node module: right-track-transit
GitHub repo: right-track/right-track-transit


This is an abstract Right Track Transit Agency. This module provides the abstract RightTrackTransitAgency class which is extended by an implementing Right Track Transit Agency.

This module also includes the Transit Feed Classes: TransitFeed, TransitDivision, TransitLine, and TransitEvent, which are all required when a Transit Agency implements the real-time Transit Feed functionality.

Documentation

Documentation can be found in the /doc/ directory of this repository or online at https://docs.righttrack.io/right-track-transit.

Supported Agencies

The following are Right Track Transit Agencies that implement this abstract class:

Transit Feed

A Transit Feed provides a list of real-time transit events. A Transit Feed is broken down into a hierarchical system where a single Transit Feed includes one or more Divisions, which in turn includes one or more Lines. A line will have an operating status and may include one or more Events, which contain real-time transit status information.

To load an agency-specific TransitFeed, use the loadFeed(callback) function where:

  • callback is a callback function: function(err, feed)
    • accepting an Error and TransitFeed as arguments.

See the Documentation for more information on the structure of a TransitFeed.

Example

The following example uses the right-track-transit-mta module to build a Transit Feed for the Metropolitan Transportation Authority.

const mta = require('right-track-transit-mta');
 
mta.loadFeed(function(err, feed) {
  if ( !err ) {
    console.log(JSON.stringify(feed, null, 2));
  }
});

Keywords

none

install

npm i right-track-transit

Downloadsweekly downloads

4

version

1.1.1

license

MIT

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability