Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
db-stations-autocomplete
Advanced tools
db-stations-autocomplete provides a stations search for Deutsche Bahn. Pulls its data from db-stations@4
(There's also db-hafas-stations-autocomplete
, which pulls its data from db-hafas-stations
).
npm install db-stations-autocomplete
autocomplete(query, results = 3, fuzzy = false, completion = true)
import {autocomplete} from 'db-stations-autocomplete'
autocomplete('Münch', 3)
This returns stations in a reduced form of the Friendly Public Transport Format. To get all details, pass use db-stations
.
[ {
id: '8000261', // München Hbf
relevance: 0.8794466403162056,
score: 11.763480191996974,
weight: 2393.2
}, {
id: '8004128', // München Donnersbergerbrücke
relevance: 0.8794466403162056,
score: 9.235186720706798,
weight: 1158
}, {
id: '8004132', // München Karlsplatz
relevance: 0.8794466403162056,
score: 9.144716179768407,
weight: 1124.3
} ]
If you set fuzzy
to true
, words with a Levenshtein distance <= 3
will be taken into account. This is a lot slower though (Apple M1, Node v19.1):
test | performance |
---|---|
non-fuzzy – berlin charlottenburg | 704 ops/sec |
fuzzy – berlin charlottenbrug (note the typo) | 204 ops/sec |
Setting completion
to false
speeds things up:
test | performance |
---|---|
completion – Münc Hbf | 477 ops/sec |
no completion – Münc Hbf | 2115 ops/sec |
If you have a question or need support using db-stations-autocomplete
, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.
FAQs
Search for stations of DB.
The npm package db-stations-autocomplete receives a total of 47,623 weekly downloads. As such, db-stations-autocomplete popularity was classified as popular.
We found that db-stations-autocomplete demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.