@bleushan/pathtern

Routing utilities

Usage no npm install needed!

<script type="module">
  import bleushanPathtern from 'https://cdn.skypack.dev/@bleushan/pathtern';
</script>

README

@bleushan/pathtern

About

For now, this is an exercise in providing a url routing function similar to switchPath while enabling some more extra stuff.

Usage

Mainly this with a few differences. Have a look at the tests.

TODO List

  • Add basic support for switchPath style routing
  • Add support for ambiguous matches
  • Add support typed dynamic routes
  • Add queryString support
  • Add support for array of routes lookup
  • Add support nested for routes