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

ripple-router

v1.0.1

Published

A lightweight router for ripple applications

Readme

Ripple Router

🚧 Alpha Version - This library is currently in alpha development and may have breaking changes.

A lightweight, type-safe router for Ripple applications.

Installation

npm install ripple-router
# or
pnpm add ripple-router
# or
yarn add ripple-router

Requirements

  • Node.js >= 20.0.0
  • Ripple framework

Quick Start

import { Router, Route, Link } from 'ripple-router';

// Define your components
export component Home() {
    <div>
        <h1>{"Welcome to Home"}</h1>
    <Link href="/about">{"Go to About"}</Link>
    </div>
}

export component About() {
    <div>
        <h1>{"About Page"}</h1>
        <Link href="/">{"Back to Home"}</Link>
    </div>
}

// Set up your router
export component App() {
    <Router>
        <Route path="/" element={Home} />
        <Route path="/about" element={About} />
    </Router>
}

API Reference

Components

Router

The root router component that manages routing state and navigation.

<Router>
    {/* Your routes go here */}
</Router>

Props:

  • children: Component - Child components (typically Route components)

Route

Defines a route with a path pattern and associated component.

<Route path="/users/:id" element={UserProfile} />

Props:

  • path: string - URL path pattern (supports dynamic segments with :)
  • element: Component - Component to render when route matches

Link

Navigational component for client-side routing.

<Link href="/dashboard">
    <span>Go to Dashboard</span>
</Link>

Props:

  • href: string - Target path
  • children: Component - Link content
  • All standard anchor (<a>) HTML attributes are also supported

Navigation Functions

navigateTo(path: string, options?: { replace?: boolean; searchParams?: Record<string, string>; hash?: string })

Programmatically navigate to a path.

import { navigateTo } from 'ripple-router';

navigateTo('/dashboard');

navigateTo(path: string, options?: { searchParams?: Record<string, string> })

Navigate with query parameters.

import { navigateTo } from 'ripple-router';

navigateTo('/search', { searchParams: { q: 'ripple', category: 'framework' } });
// Navigates to: /search?q=ripple&category=framework

navigateTo(path: string, options?: { hash?: string })

Navigate with a hash fragment.

import { navigateTo } from 'ripple-router';

navigateTo('/docs', { hash: 'installation' });
// Navigates to: /docs#installation

Types

RouteProps

Props passed to route components (legacy, use TypedRouteProps for type safety):

type RouteProps = {
    params: Record<string, string>;      // Dynamic route parameters
    searchParams?: Record<string, string>; // Query parameters
};

TypedRouteProps<T>

Type-safe props for route components based on path pattern:

type TypedRouteProps<T extends string> = {
    params: ExtractPathParams<T>;        // Automatically inferred parameters
    searchParams?: Record<string, string>; // Query parameters
};

ExtractPathParams<T>

Utility type that extracts parameter names and types from a path string:

type ExtractPathParams<"/users/:id/posts/:postId"> = {
    id: string;
    postId: string;
}

Dynamic Routes

Support for dynamic route segments using : syntax:

// Route definition
<Route path="/users/:userId/posts/:postId" element={PostDetail} />

// Component receives params
export component PostDetail(props: RouteProps) {
    const { params } = props;
    // params.userId and params.postId are available
    
    <div>
        <h1>Post {params.postId} by User {params.userId}</h1>
    </div>
}

Not Found Pages

Use the ** wildcard pattern to create a catch-all route for 404 pages:

export component NotFound() {
    <div>
        <h1>404 - Page Not Found</h1>
        <p>The page you're looking for doesn't exist.</p>
        <Link href="/">Go back home</Link>
    </div>
}

// Add the not found route at the end of your routes
export component App() {
    <Router>
        <Route path="/" element={Home} />
        <Route path="/about" element={About} />
        <Route path="/users/:id" element={UserProfile} />
        {/* Catch-all route for 404 pages */}
        <Route path="**" element={NotFound} />
    </Router>
}

Important: The ** route should be placed last in your route definitions, as it will match any path that hasn't been matched by previous routes.

Development Status

⚠️ This is an alpha release - The API may change significantly before the stable release. Use in production at your own risk.

Known Issues

  • TypeScript integration is still being refined
  • API may have breaking changes in future versions

Contributing

This project is part of the Ripple framework ecosystem. Contributions are welcome!

License

MIT License - see the LICENSE file for details.

Author

Michal Makowski ([email protected])


Note: This router is specifically designed for the Ripple framework and requires Ripple as a peer dependency.