npm

@navaru/url-path-router

2.0.1 • Public • Published

@navaru/url-path-router

URL path router (radix tree based)

Example

import { route, match } from '@navaru/url-path-router'


// create a path tree
const root = route('/users', onIndex)

// add another route on tree
route('/users/:id/profile', onProfile, root)
route('/users/:id/settings', onSettings, root)

const { unmatched, keys, handlers } = match('/users/1234/settings', root)

License ISC

Readme

Keywords

none

Package Sidebar

Install

npm i @navaru/url-path-router

Weekly Downloads

1

Version

2.0.1

License

ISC

Last publish

Collaborators

  • navaru