2.9.0 • Published 6 years ago
search-meinfernbus-locations v2.9.0
search-meinfernbus-locations
Search for Flixbus/Meinfernbus regions & stations.
Installing
npm install search-meinfernbus-locations
Usage
autocomplete(query, limit = 6, fuzzy = false, completion = true)
const pick = require('lodash.pick')
const search = require('search-meinfernbus-locations')
console.log(search('berlin', 5))
[ {
id: '88',
name: 'Berlin',
type: 'region',
relevance: 3.455855112783178,
score: 27.984681385568972,
weight: 531
}, {
id: '1224',
name: 'Berlin Alexanderplatz',
type: 'station',
relevance: 1.727927556391589,
score: 7.743542752920189,
weight: 90
}, {
id: '481',
name: 'Berlin Südkreuz',
type: 'station',
relevance: 1.727927556391589,
score: 7.445414138704126,
weight: 80
}, {
id: '471',
name: 'Berlin SXF',
type: 'station',
relevance: 1.727927556391589,
score: 7.121282437290776,
weight: 70
}, {
id: '2825',
name: 'Berlin Zoo',
type: 'station',
relevance: 1.727927556391589,
score: 5.369072671153364,
weight: 30
} ]
If you set fuzzy
to true
, words with a Levenshtein distance <= 3
will be taken into account. This is a lot slower though.
Contributing
If you have a question, found a bug or want to propose a feature, have a look at the issues page.
2.9.0
6 years ago
2.8.0
6 years ago
2.7.0
6 years ago
2.6.0
6 years ago
2.5.0
6 years ago
2.4.0
6 years ago
2.3.0
6 years ago
2.2.1
6 years ago
2.2.0
6 years ago
2.1.0
6 years ago
2.0.1
6 years ago
1.32.0
6 years ago
1.25.0
6 years ago
1.20.0
7 years ago
1.16.0
7 years ago
1.11.0
7 years ago
1.5.0
7 years ago
2.0.0
7 years ago
1.0.0
7 years ago
0.1.0
8 years ago