matthewmueller / routematch

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.


Languages

Language:JavaScript 96.3%Language:Makefile 3.7%