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

@aglyn/plugins-redirects

v1.0.0-beta.172

Published

The Redirects plugin for Aglyn: URL redirect rules for a site, the console page that manages them, and the server hook that answers a request with a redirect before the site resolves a route. Install it if you run the Aglyn console and tenant runtime and

Readme

@aglyn/plugins-redirects

The Redirects plugin for Aglyn: URL redirect rules for a site, the console page that manages them, and the server hook that answers a request with a redirect before the site resolves a route. Install it if you run the Aglyn console and tenant runtime and want redirect rules; it is a first-party plugin, not a standalone library.

Beta. Published from the Aglyn monorepo under the beta dist-tag; APIs can change between beta releases.

Install

npm install @aglyn/plugins-redirects@beta

Peer dependencies: react, @mui/material, firebase, and firebase-admin for the server entry.

What's in it

On a published site. Nothing is drawn. Redirects are enforced on the server: registerRedirectsApi (the tenantApi registrar, exported from @aglyn/plugins-redirects/server) registers a site redirect resolver with @aglyn/aglyn/server. For each request the resolver is given the host and path and returns a destination and status code, or nothing.

Console (registerRedirectsConsole, the console registrar): a Redirects nav item at /redirects, gated by the redirects entitlement. The page is code-split and loads when opened.

The rule model, exported from .:

  • HostRedirect: a rule's source, destination, statusCode (REDIRECT_STATUS_CODES), kind (REDIRECT_KINDS: exact, prefix, regex), priority and enabled.
  • matchRedirect(rules, path): evaluates rules in priority order and returns a RedirectMatch or null. Disabled, self-targeting and invalid rules never fire, and an external destination is served only when the rule records the publisher who approved it.
  • validateRedirectRule, compileRedirectRegex, normalizeRedirectSource, normalizeRedirectDestination, isExternalRedirectDestination, isSelfRedirect, REDIRECT_DEFAULT_PRIORITY.
  • BUNDLE_ID ('redirects').

Usage

The plugin is loaded through Aglyn's plugin manager: the generated loader manifests import the package and call the registrars named in plugins.config.json. An app that wires plugins by hand calls them once at startup:

// console, client side
import { registerRedirectsConsole } from '@aglyn/plugins-redirects'
registerRedirectsConsole()

// tenant runtime, server side
import { registerRedirectsApi } from '@aglyn/plugins-redirects/server'
registerRedirectsApi()

The matcher is pure and can be used directly:

import { matchRedirect, type HostRedirect } from '@aglyn/plugins-redirects'

const rules: HostRedirect[] = [
  { source: '/old', destination: '/new', statusCode: 301 },
]
const match = matchRedirect(rules, '/old')
// match?.destination === '/new'

How it fits

A plugin package (scope:plugin). It depends on the core (@aglyn/aglyn), the tenant packages (@aglyn/tenant-data-admin, @aglyn/tenant-feature-instance) and generic @aglyn/shared-* packages. It imports no other plugin, and the core never imports it: the tenant runtime asks whichever resolver is registered, and the console reaches the page through the loader manifest.

License

Apache-2.0. Source: https://github.com/aglyn/aglyn/tree/main/libs/plugins/redirects