Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gtfs-rt-bindings

derhuerst983ISC4.7.0

Parse and serialize GTFS Realtime data encoded as protocol buffers.

gtfs realtime, gtfs rt, transit, public transport, realtime, parse, serialize

readme

gtfs-rt-bindings

Parse and serialize GTFS Realtime. Updated more frequently than gtfs-realtime-bindings.

npm version ISC-licensed support me via GitHub Sponsors chat with me on Twitter

Installing

npm install gtfs-rt-bindings

Usage

const {TripUpdate} = require('gtfs-rt-bindings')

const data = {
    trip: {
        trip_id: 'trip-1',
        route_id: 'route-1'
    },
    stop_time_update: [{
        stop_sequence: 3,
        arrival: {delay: 30}
    }]
}


TripUpdate.verify(data)
const buf = TripUpdate.encode(data).finish()
console.log(buf)
// <Buffer 0a 11 0a 06 74 72 69 70 2d 31 2a 07 72 6f 75 74 65 2d 31 12 06 08 03 12 02 08 1e>

const parsedData = TripUpdate.toObject(TripUpdate.decode(buf))
console.log(parsedData)

Contributing

If you have a question or have difficulties using gtfs-rt-bindings, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, refer to the issues page.