0.0.10 • Published 4 months ago

route-peek v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

🧱 Route Peek

NPM Version NPM Downloads npm bundle size NPM License

The library for creating and matching dynamic routes.

Documentation

šŸ‘‰ Read the Route Peek docs

Prerequisites

Installation

You can install route-peek using the JavaScript package manager:

npm add route-peek

Usage

import { RouteMatcherBuilder } from 'route-peek';

const builder = new RouteMatcherBuilder();

builder.add('/');
builder.add('/users');
builder.add('/users/{id:[0-9]+}');

const matcher = builder.build();
const matchedRoutes = matcher.match('/users/1234');

console.log(matchedRoutes); // [{"path":"/users/1234","route":"/users/{id:[0-9]+}","params":{"id":"1234"},"score":154}]

License

MIT

0.0.10

4 months ago

0.0.9

4 months ago

0.0.8

9 months ago

0.0.5

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago