4.9.0 • Published 18 days ago

vbb-stations-autocomplete v4.9.0

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

vbb-stations-autocomplete

vbb-stations-autocomplete provides a stations search for the Berlin Brandenburg public transport service (VBB). It pulls its data from vbb-stations.

Note: Because there are ~ 13k stations, this module contains ~ 800k of data (~ 240k gzipped).

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

Installing

npm install vbb-stations-autocomplete

Usage

autocomplete(query, results = 3, fuzzy = false, completion = true)
const autocomplete = require('vbb-stations-autocomplete')
autocomplete('Seestr', 3)

This returns stations in a reduced form of the Friendly Public Transport Format. To get all details, pass each id into vbb-stations.

[
	{
		id: '900000009103', // U Seestr.
		relevance: 2.0817557,
		score: 40.8276194
	}, {
		id: '900000009105', // Seestr./Amrumer Str.
		relevance: 1.0408778,
		score: 15.7013362
	}, {
		id: '900000019103', // Seestr./Beusselstr.
		relevance: 1.3878371,
		score: 12.3226614
	}
]

If you set fuzzy to true, words with a Levenshtein distance <= 3 will be taken into account. This is a lot slower though:

testperformance
non-fuzzy – U mehringdamm325 ops/sec
fuzzy – U mehrigndamm73 ops/sec

Setting completion to false speeds things up a lot:

testperformance
completion – U friedr306 ops/sec
no completion – U friedr5076 ops/sec

Contributing

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

4.9.0

18 days ago

4.8.0

2 months ago

4.7.0

3 months ago

4.6.1

3 months ago

4.6.0

3 months ago

4.5.0

1 year ago

4.4.0

2 years ago

4.3.1

3 years ago

4.3.0

4 years ago

4.2.0

4 years ago

4.1.0

5 years ago

4.0.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.1

6 years ago

2.10.0

6 years ago

2.9.0

7 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.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.10.0

8 years ago

0.9.0

8 years ago

0.8.0

8 years ago

0.7.0

8 years ago

0.6.1

8 years ago

0.6.0

8 years ago

0.5.0

8 years ago

0.4.2

9 years ago

0.4.1

9 years ago

0.4.0

9 years ago

0.3.0

9 years ago

0.2.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago