4.5.0 • Published 18 days ago

vbb-trips v4.5.0

Weekly downloads
1
License
ISC
Repository
github
Last release
18 days ago

vbb-trips 🚏

Raw data about when VBB trains stop at which stations. Computed from open GTFS data.

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

Installing

npm install vbb-trips

Usage

const data = require('vbb-trips')

data.lines([promise], [id]) and data.schedules([promise], [id]) return a Promise if promise is true. Otherwise, they return a readable stream in object mode.

lines

data.lines(true, '17289_700') // query a single line
.then(console.log, console.error)

This will give you line objects in the Friendly Public Transport Format.

[{
	type: 'line',
	id: '17289_700',
	operator: '796',
	name: '100',
	mode: 'bus',
	product: 'bus',
	weight: 392507
}]

schedules

data.schedules()
.on('data', console.log)
.on('error', console.error)

This will give you schedule objects in the Friendly Public Transport Format.

{
	type: 'schedule',
	id: 'Z2txwLd',
	route: {
		type: 'route',
		id: 'Z2txwLd',
		line: '4221_700',
		stops: [
			'750000105901' // station IDs
			// …
		]
	},
	sequence: [
		{departure: 0}, // seconds since departure at first stop
		// …
	],
	starts: [
		1509978000 // Unix timestamp at the first stop
		// …
	]
}

Contributing

If you have a question, found a bug or want to propose a feature, have a look at the issues page.

4.5.0

18 days ago

4.4.0

2 months ago

4.3.0

3 months ago

4.2.0

1 year ago

4.1.0

2 years ago

4.0.0

2 years ago

3.13.1

3 years ago

3.13.0

4 years ago

3.12.0

4 years ago

3.11.0

5 years ago

3.10.0

5 years ago

3.9.0

5 years ago

3.8.0

5 years ago

3.7.0

5 years ago

3.6.0

6 years ago

3.5.0

6 years ago

3.4.0

6 years ago

3.3.0

6 years ago

3.2.0

6 years ago

3.1.0

6 years ago

3.0.0

6 years ago

2.11.0

6 years ago

2.10.0

6 years ago

2.9.0

6 years ago

2.8.0

7 years ago

2.7.0

7 years ago

2.6.0

7 years ago

2.5.0

7 years ago

2.4.1

7 years ago

2.4.0

7 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago

0.4.0

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago