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

@excom/routable-element

v0.2.2

Published

RoutableElement base for Neutron elements

Readme

routable-element

URL matching for custom elements — give any Neutron class a route-href and react when the address bar changes.

Features

  • Path patterns Named params (/users/:id) and wildcards
  • Regex routes Full control via route-regex (ignored when route-href is set); named groups ((?<id>\d+)) become params, in a path pattern too, unnamed ones stay in match
  • Nested match Keep layouts active under child paths
  • Live updates Rematch when route-href / route-regex change

Installation

@excom/routable-element v0.2.2

pnpm add @excom/routable-element
npm install @excom/routable-element
yarn add @excom/routable-element

Import

import { /* … */ } from "@excom/routable-element";

Usage

Compose RoutableElement and implement routeChanged. Concrete consumers include <spa-route>, <spa-a>, and <spa-manager>.

import { Neutron } from "@excom/neutron";
import { RoutableElement } from "@excom/routable-element";

export const PathAware = Neutron.compose([
  RoutableElement,
  Neutron({
    tag: "path-aware",
    props: {
      isActive: Boolean,
    },
  }),
])
  .defineMethods({
    routeChanged: (_el, { match }) => ({ isActive: !!match }),
  });

PathAware.define();
<path-aware route-href="/dashboard" match-nested></path-aware>

API Reference

Attributes

| Name | Surface | Type | Default | Values | Description | | --- | --- | --- | --- | --- | --- | | route-href | option | string | | <path pattern> | URL pattern to match. Supports named placeholders (/users/:id) and wildcards: *rest matches one path segment, a bare * across segments. A relative pattern (checkout) resolves against the page's <base>; without one, against the page URL at registration. Set this or route-regex; with both, this one wins. | | route-regex | option | string | | <RegExp source> | RegExp source string matched against the pathname (never the query or hash) — alternative to route-href for catch-alls / advanced patterns, ignored when route-href is set. Here and in a route-href, named groups become params ((?<id>\d+) → params.id); unnamed groups stay in match. | | match-nested | option | boolean | | | Also match child paths of route-href: /users matches /users and /users/42, never /usersx. Essential for layout routes and nested SPAs. |

Examples

Path match & nested layouts

route-href activates on exact match; with match-nested it also matches child paths, keeping a layout mounted.

<spa-route route-href="/users" match-nested>
  <template>…layout…</template>
</spa-route>

Catch-all via regex

<spa-route route-regex=".*" is-fallback>
  <template>404</template>
</spa-route>

Release notes

0.2.0 (2026-09-30)

  • Update match-nested to match its own path as well as child paths: route-href="/users" is active at /users, so a separate route for that path renders beside it and a 404 fallback stays off there
  • Add relative route-href values: checkout resolves against the page's <base>, or against the page URL at registration when there is none
  • Fix an issue where a routable element inside persist-content threw a NeutronError when re-attached
  • Fix an issue where an element given a route-href while detached registered a route, and a route-regex element stayed registered after it was removed
  • Fix an issue where changing match-nested at runtime had no effect

0.1.1 (2026-09-23)

  • Ship only dist (and declared extras) in the npm tarball; drop build logs, tests and sources

Full documentation: https://nucleus.excom.dev/packages/routable-element