
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
@e22m4u/js-path-trie
Advanced tools
Маршрутизатор для Node.js на основе префиксного дерева (trie).
Требуется Node.js 16 и выше.
npm install @e22m4u/js-path-trie
Модуль поддерживает ESM и CommonJS стандарты.
ESM
import {PathTrie} from '@e22m4u/js-path-trie';
CommonJS
const {PathTrie} = require('@e22m4u/js-path-trie');
Класс PathTrie имеет следующие методы:
add(pathTemplate: string, value: unknown) добавить значение к новому маршрутуmatch(path: string) поиск значения по заданному маршрутуПример:
import {PathTrie} from '@e22m4u/js-path-trie';
const trie = new PathTrie();
// добавление маршрутов выполняется
// методом "add", который принимает
// шаблон маршрута и его значение
trie.add('/foo/bar', yourValue1);
trie.add('/foo/:p1/bar/:p2', yourValue2);
// для поиска значения используется
// метод "match", который возвращает
// значение маршрута и его параметры
trie.match('/foo/bar');
// {
// value: yourValue1,
// params: {}
// }
// если маршрут имеет параметры,
// то их значения вернуться
// в результате поиска
trie.match('/foo/10/bar/20');
// {
// value: yourValue2,
// params: {p1: 10, p2: 20}
// }
// если маршрут не найден,
// то возвращается "undefined"
trie.match('/foo/bar/baz');
// undefined
Установка переменной DEBUG включает вывод логов.
DEBUG=jsPathTrie* npm run test
npm run test
MIT
FAQs
Маршрутизатор для Node.js на основе префиксного дерева
The npm package @e22m4u/js-path-trie receives a total of 34 weekly downloads. As such, @e22m4u/js-path-trie popularity was classified as not popular.
We found that @e22m4u/js-path-trie demonstrated a healthy version release cadence and project activity because the last version was released less than 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
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.