Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Stupidly simple regular expression pushState router

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.md
Octocat-spinner-32 index.js
Octocat-spinner-32 package.json
README.md

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

Something went wrong with that request. Please try again.