html5-router

A uri router backed by html5 history api

npm install html5-router
12 downloads in the last month

html5-router

A uri router backed by html5 history api

Example

var Router = require("html5-router")

var router = Router()
router.addRoute("/", renderHome)
router.addRoute("/login", showLoginDialog)

router.on("route", function (event) {
  console.log("event", { url: event.url, data: event.data })
})

Router.on("popstate", router)
router()

Installation

npm install html5-router

Contributors

  • Raynos

MIT Licenced

npm loves you