Skip to content

Given a journey, get alternatives for each leg from HAFAS.

License

Notifications You must be signed in to change notification settings

derhuerst/hafas-find-alternative-legs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hafas-find-alternative-legs

Given a hafas-client journey, get alternatives for each leg from HAFAS.

npm version build status ISC-licensed chat with me on Gitter support me on Patreon

Installation

npm install hafas-find-alternative-legs

Usage

const createHafas = require('bvg-hafas')
const createFetchAlternatives = require('hafas-find-alternative-legs')

const hafas = createHafas('my awesome program')
const fetchAlternatives = createFetchAlternatives(hafas)

const friedrichstr = '900000100001'
const senefelderplatz = '900000110005'

hafas.journeys(friedrichstr, senefelderplatz, {results: 1})
.then(([journey]) => fetchAlternatives(journey))
.then((journeyWithAlternatives) => {
	console.log(journeyWithAlternatives.legs)
})
.catch(console.error)

Contributing

If you have a question or need support using hafas-find-alternative-legs, 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.

About

Given a journey, get alternatives for each leg from HAFAS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages