0.2.0 • Published 7 years ago

vbb-departures-in-direction v0.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

vbb-departures-in-direction

Get departures at a VBB station in a certain direction. Uses vbb-hafas.

npm version build status ISC-licensed chat on gitter

Installing

npm install vbb-departures-in-direction

Usage

Specify the direction as the next station after the one you're querying departures for. depsInDirection will then query departures, advancing the time until it found enough results or sent enough requests.

const depsInDirection = require('vbb-departures-in-direction')

const friedrichstr = '900000100001' // where to get departures
const brandenburgerTor = '900000100025' // direction

depsInDirection(friedrichstr, brandenburgerTor)
.then(console.log)
.catch(console.error)

API

depsInDirection(station, direction, [opt])

opt overrides the following defaults:

{
	concurrency: 4, // max nr. of parallel requests
	results: 10, // nr. of results to collect
	maxQueries: 10 // max nr. of requests
}

Contributing

If you have a question or have difficulties using vbb-departures-in-direction, 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.