25.0.0-beta.3 • Published 8 months ago

@contextjs/routing v25.0.0-beta.3

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

@contextjs/routing

Tests npm License

Declarative, extensible route matching and configuration for ContextJS-based applications.

Features

  • Fully type-safe and fluent route configuration
  • Support for literal, parameterized, optional, and catch-all route templates
  • Fast route matching with scoring and early-exit optimization
  • URI decoding, normalization, and edge-case tolerance
  • Integration with the Application class via useRouting()

Installation

npm i @contextjs/routing

Usage

import { Application } from "@contextjs/system";
import { RouteInfo } from "@contextjs/routing";

const app = new Application();
app.useRouting();

Matching Example

import { RouteService } from "@contextjs/routing";

const route = RouteService.match("home/123/details", [...routeDefinitions]);

console.log(route?.template); // "home/{id?}/details"

API Reference

For detailed API documentation, please refer to the API Reference.

Testing

All features are covered by 100% unit test coverage, ensuring reliability, correctness, and long-term maintainability - so you can focus on building, not debugging.

25.0.0-beta.3

8 months ago

25.0.0-beta.2

8 months ago

25.0.0-beta.1

8 months ago

0.5.3-alpha.1

8 months ago

0.5.2-alpha.1

8 months ago

0.5.1-alpha.1

9 months ago

0.5.0-alpha.1

9 months ago

0.4.8

10 months ago

0.4.7

10 months ago

0.4.6

10 months ago

0.4.5

10 months ago

0.4.4

10 months ago

0.4.3

10 months ago

0.4.2

10 months ago

0.4.1

10 months ago