2.40.0 • Published 4 years ago

search-flix-locations v2.40.0

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

search-flix-locations

Search for Flix/Flixbus/Meinfernbus regions & stations.

asciicast

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

Installing

npm install search-flix-locations

Usage

autocomplete(query, limit = 6, fuzzy = false, completion = true)
const pick = require('lodash.pick')
const search = require('search-flix-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.40.0

4 years ago

2.39.0

4 years ago

2.38.0

4 years ago

2.37.0

4 years ago

2.36.0

4 years ago

2.35.0

4 years ago

2.34.0

4 years ago

2.33.0

4 years ago

2.32.0

4 years ago

2.31.0

4 years ago

2.30.0

4 years ago

2.29.0

4 years ago

2.28.0

5 years ago

2.27.0

5 years ago

2.26.0

5 years ago

2.25.0

5 years ago

2.24.0

5 years ago

2.23.1

5 years ago

2.23.0

5 years ago

2.22.0

5 years ago

2.21.0

5 years ago

2.20.0

5 years ago

2.19.0

5 years ago

2.18.0

5 years ago

2.17.0

5 years ago

2.16.0

5 years ago

2.15.0

5 years ago

2.14.0

6 years ago

2.13.0

6 years ago

2.12.0

6 years ago

2.11.0

6 years ago

2.10.0

6 years ago

2.9.0

6 years ago

2.2.1

6 years ago