Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/derhuerst/gtfs-rt-bindings
Parse and serialize GTFS Realtime data encoded as protocol buffers.
https://github.com/derhuerst/gtfs-rt-bindings
gtfs gtfs-realtime parse public-transport serialize transit
Last synced: about 1 month ago
JSON representation
Parse and serialize GTFS Realtime data encoded as protocol buffers.
- Host: GitHub
- URL: https://github.com/derhuerst/gtfs-rt-bindings
- Owner: derhuerst
- License: isc
- Created: 2017-09-08T16:27:49.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-01T08:20:52.000Z (3 months ago)
- Last Synced: 2024-10-26T21:50:24.560Z (about 2 months ago)
- Topics: gtfs, gtfs-realtime, parse, public-transport, serialize, transit
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 3
- Watchers: 4
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# gtfs-rt-bindings
**Parse and serialize [GTFS Realtime](https://developers.google.com/transit/gtfs-realtime/index).** Updated more frequently than [`gtfs-realtime-bindings`](https://github.com/google/gtfs-realtime-bindings).
[![npm version](https://img.shields.io/npm/v/gtfs-rt-bindings.svg)](https://www.npmjs.com/package/gtfs-rt-bindings)
![ISC-licensed](https://img.shields.io/github/license/derhuerst/gtfs-rt-bindings.svg)
[![support me via GitHub Sponsors](https://img.shields.io/badge/support%20me-donate-fa7664.svg)](https://github.com/sponsors/derhuerst)
[![chat with me on Twitter](https://img.shields.io/badge/chat%20with%20me-on%20Twitter-1da1f2.svg)](https://twitter.com/derhuerst)## Installing
```shell
npm install gtfs-rt-bindings
```## Usage
```js
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)
//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](https://github.com/derhuerst/gtfs-rt-bindings/issues).