New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

vbb-stations-autocomplete

Package Overview
Dependencies
Maintainers
0
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vbb-stations-autocomplete

Search for stations of VBB.

  • 4.16.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
15
increased by66.67%
Maintainers
0
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 10 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc