reru

Stupidly simple regular expression pushState router

npm install reru
1 downloads in the last week
4 downloads in the last month

reru

Stupidly simple regular expression pushState router.

build status dependency status dev dependency status

browser support

Example

var reru = require('reru');

reru(/.*/, function () {
  content.innerHTML = '';
});

reru('^/$', function () {
  var p = document.createElement('p');
  p.appendChild(document.createTextNode('Welcome'));
  content.appendChild(p);
});

reru('^/(\\d{4})$', function (year) {
  var p = document.createElement('p');
  p.appendChild(document.createTextNode('Archive for' + year));
  content.appendChild(p);
});

License

MIT

npm loves you