Skip to content

stenin-nikita/route-peek

Repository files navigation

🧱 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 { PathPattern } from 'route-peek';

const pattern = new PathPattern('/users/{id:[0-9]+}');

console.log(pattern.test('/users/1234')); // true
console.log(pattern.exec('/users/1234')); // { id: '1234' }

License

MIT