npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@vobs/router

v1.8.4

Published

Signals-first client router for Vobs with guards, route loaders, and cancellation of superseded navigations.

Downloads

6,700

Readme

@vobs/router

Signals-first client router for Vobs with guards, route loaders, and cancellation of superseded navigations.

Install

npm install @vobs/router

Quick start

import { createVobs, createText } from '@vobs/vobs'
import { createRouter, createMemoryHistory, RouterView, routerPlugin } from '@vobs/router'

const router = createRouter({
  history: createMemoryHistory('/'),
  routes: [
    { path: '/', name: 'home', component: () => createText('home') },
    { path: '/users/:id', name: 'user', component: () => createText('user') }
  ]
})

// Guards return undefined (allow), false (cancel), or a redirect target.
router.beforeEach(to => (to.path.startsWith('/admin') ? '/login' : undefined))

const app = createVobs({
  render: () => RouterView({ loading: () => createText('loading'), notFound: () => createText('not-found') }),
  plugins: [routerPlugin({ router })]
})

await router.push({ name: 'user', params: { id: '7' }, query: { tab: 'activity' } })
router.currentRoute.value.fullPath // '/users/7?tab=activity'

API

| Signature | Description | | --- | --- | | createRouter(options: RouterOptions): Router | Creates a router; defaults to browser history in the DOM and memory history otherwise. | | router.currentRoute: Signal<RouteLocation> | Reactive current route with path, params, query, hash, meta, and matched records. | | router.push(to: RouteTarget) | Navigates and resolves to the new RouteLocation, or false when a guard cancels. | | router.replace(to: RouteTarget) | Like push but replaces the history entry. | | router.resolve(to: RouteTarget): RouteLocation | Resolves a target to a location without navigating. | | router.back(): void | Goes back in history. | | router.beforeEach(guard: NavigationGuard): () => void | Registers a global guard and returns its unregister function. | | router.getViewState(route: RouteLocation): RouterViewState | Resolves ready, loading, error, or not-found for the matched components. | | router.devtools: RouterDevToolsAPI | Navigation traces, data-request tracking, errors, metrics, and revalidation. | | router.destroy(): void | Stops history listening and disposes internal signals. | | routerPlugin(options?: RouterPluginOptions): VobsPlugin | Provides the router through ROUTER_KEY. | | RouterView(props?: RouterViewProps): VobsNode | Renders the matched component with nested layouts plus loading, notFound, and error slots. | | useRouter(): Router | Injects the router inside components. | | useRoute(): Signal<RouteLocation> | Injects the current-route signal. | | lazy(loader: RouteComponentLoader): LazyRouteComponent | Wraps a dynamic import as a lazy route component. | | createMemoryHistory(initial?): RouterHistory | In-memory history for tests and SSR. | | createBrowserHistory(base?): RouterHistory | History API adapter with popstate support. | | createHashHistory(): RouterHistory | Hash-based history (#/path?query) with hashchange support; no server fallback needed. |

Guards and route loaders run before a navigation commits. A newer navigation cancels the pending one: its promise rejects with NavigationCancelledError, and a late loader result cannot overwrite the current route or history. Guard redirects are capped at 10 hops (NavigationRedirectError).

Types

RouteLocation, RouteRecord, RouteComponent, RouteComponentProps, RouteComponentModule, RouteComponentLoader, RouteComponentDefinition, LazyRouteComponent, RouteLoader, RouteLoaderContext, NavigationGuard, NavigationGuardResult, RouteTarget, RouteLocationRaw, RouteQueryInput, RouteParams, RouteQuery, RouteQueryValue, RouteMeta, RouterOptions, RouterHistory, RouterViewState, Router, RouterViewProps, RouterPluginOptions, NavigationState, NavigationTrace, RouteErrorTrace, NavigationCancelledError, NavigationRedirectError, RouterPerformanceMetrics, RouterDevToolsAPI, RouterDevToolsEvent, RouterDataRequestKind, RouterDataRequestTrace, RouterDataRequestOptions, RouteDebugNode, RouterDebugEvent, RouterDebugEventType