Skip to content

matthewmueller/routematch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

routematch

simple, functional route matcher for node.js and the browser.

install

npm install routematch

examples

// single
const { user } = match(document.location.pathname, '/user/:user')
assert.equal(user, 'matt')

// fallbacks
const { author, article } = match('/matt/node.js-guide', '/user/:user', '/:author/:article')
assert.equal(author, 'matt')
assert.equal(article, 'node.js-guide')

license

MIT

About

simple, functional route matcher for node.js and the browser.

Resources

Stars

Watchers

Forks

Packages

No packages published