1.0.0 • Published 7 years ago

routemap v1.0.0

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

Routemap

Simple resolver for paths

Installation

yarn add routemap

Example

const route = Route({
  '/:user': '/user?hello=1',
  '/': '/landing'
})
assert.equal(route('/matt'), '/user?hello=1')
assert.equal(route('/matt?cool=hi'), '/user?cool=hi&hello=1')

TODO

  • Support accessing the resolved parameters

    [ '/user?hello=1', { user: 'matt' } ] = route.match('/matt')

License

mit