Add the Dependency
To use the
gtfs-realtime-bindings classes in your own project, you need to
first install our Node.js npm package:
npm install gtfs-realtime-bindings
The following Node.js code snippet demonstrates downloading a GTFS-realtime data feed from a particular URL, parsing it as a FeedMessage (the root type of the GTFS-realtime schema), and iterating over the results.
var GtfsRealtimeBindings = ;var request = ;var requestSettings =method: 'GET'url: 'URL OF YOUR GTFS-REALTIME SOURCE GOES HERE'encoding: null;;