A lightweight, UI-agnostic SPA navigation engine built on top of the native History API.
Direction-aware route lifecycle hooks including
onArrive,
onMeet,
onReturn,
and onComeback.
Supports expressive route patterns such as
/user/:id.
Execute middleware pipelines before lifecycle execution.
Works with both native history navigation and hash-based routing.
Block route transitions safely using canLeave().
Optional trie-based route matcher for large route trees.
historypp.config({
mode: "history"
});
historypp.router("/", {
onMeet() {
console.log("Home");
}
});
historypp.navigateReplace(location.pathname);