1.6.0 • Published 3 years ago

right-track-agency-mnr v1.6.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

Metro North Railroad & SLE

node module: right-track-agency-mnr
GitHub repo: right-track/right-track-agency-mnr


This module is an implementation of a right-track-agency used to add agency-specific configuration and functionality to various Right Track Projects.

Features

This module provides the following agency-specific information:

  • Build Scripts for creating a Right Track Database for MNR (using the right-track-db-build project)
  • The latest compiled Right Track Database for MNR (located in the ./static/db directory)
  • Agency configuration properties to be used in various Right Track projects
  • The functions to generate a MNR Station Feed for the right-track-server

NOTE: Archived schedule databases are no longer stored in the git repository due to their storage size. Archived Metro North databases can be found in this shared Google Drive folder.

Documentation

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

Additional documentation about the RightTrackAgency class can be found in the right-track-agency project and online at https://docs.righttrack.io/right-track-agency.

Usage

On require the module will return a new instance of the Metro North Railroad & SLE implementation of a RightTrackAgency Class.

To get the agency configuration properties:

const MNR = require('right-track-agency-mnr');

// Optionally load an additional configuration file
MNR.readConfig('/path/to/config.json');

// Get the merged configuration
let config = MNR.getConfig();

To get the real-time StationFeed for Grand Central Terminal:

const core = require('right-track-core');
const RightTrackDB = require('right-track-db-sqlite3');
const MNR = require('right-track-agency-mnr');

// Set up the Right Track DB for Metro North
let db = new RightTrackDB(MNR);

// Get the Stop for Grand Central Terminal (id='1') by querying the RightTrackDB
core.query.stops.getStop(db, '1', function(err, stop) {
  
  // Load the StationFeed for Grand Central Terminal
  MNR.loadFeed(db, stop, function(err, feed) {
    
    // Do something with the feed
    console.log(feed);
    
  });
  
});
1.6.0

3 years ago

1.5.0

5 years ago

1.4.4

5 years ago

1.4.3

6 years ago

1.4.2

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago