discover-vbb-stations
Discover VBB stations by querying departures. It tries to find all stations that all trains known by VBB stop at. Analogous to discover-db-stations
.
Installing
npm install discover-vbb-stations
Usage
using the command line
Using npx:
npx discover-vbb-stations [station-id] >stations.ndjson
using JavaScript
const walk = // where to start
walk()
returns a readable stream in object mode. It emits the following events:
data
: a new station that has been discoveredstats
: an object with the following keys:stations
: the number of stations discoveredrequests
: the number of requests sentqueued
: the number of queued station IDs
edge
: a connection between two stations, with the following keys:source
: a Friendly Public Transport Format1.0.1
station
objecttarget
: a Friendly Public Transport Format1.0.1
station
objectduration
: time to travel, in millisecondsline
: an vbb-hafasline
object
API
stationId
must be a string and a valid IBNR.
opt
may have the following keys. It will be passed into queue()
.
concurrency
: number of requests run in parallel – default:2
timeout
: timeout for a single job in milliseconds – default:10000
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.