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

@de-otio/trellis-extension-api

v0.10.0

Published

Shared types for Trellis extensions: TrellisExtension, Route, strategy interfaces

Readme

@de-otio/trellis-extension-api

Shared types for building Trellis extensions: TrellisExtension, Route, the strategy/hook interfaces, and the ExtensionContext an extension receives at registration. Trellis is a generic multi-tenant social-network platform core; vertical applications extend it by registering a TrellisExtension at startup to add domain-specific routes, metadata schemas, and terminology.

Reference

The canonical Extension API reference — the full TrellisExtension contract, how a vertical registers an extension, and the review criteria (tracker-free / anonymized client metadata, and AI Act Art. 50 synthetic-content provenance disclosure) — lives in the Trellis docs:

→ Extension API reference

Install

npm install @de-otio/trellis-extension-api
import type { TrellisExtension } from "@de-otio/trellis-extension-api";
import { EXTENSION_API_VERSION } from "@de-otio/trellis-extension-api";

Declare extensionApiVersion: EXTENSION_API_VERSION on your TrellisExtension so Trellis core checks compatibility for you at startup, instead of comparing EXTENSION_API_VERSION by hand — see the extensionApiVersion reference.

Trust model — extensions are NOT sandboxed

Registering a TrellisExtension is a decision to trust that code at the same level as Trellis core code. There is no isolation boundary. Read this before loading an extension you did not write.

Two ways to add routes, with very different exposure:

| | extensionRoutes (preferred) | routes (raw, legacy) | |---|---|---| | Auth | enforced by core (auth: "required" by default) | whatever the extension does — core does not check | | CSRF / CORS | applied by core | not applied | | Security headers | applied by core | not applied | | Rate limiting | applied by core for cross-tenant-capable extensions | not applied | | Handler receives | a scoped ExtensionContext (tenant-scoped db, no secrets) | the full core Env |

The full core Env includes SESSION_SECRET, SESSION_SALT, DATABASE_URL, every KV binding and every queue handle. A raw route can therefore mint session cookies for arbitrary users, read or write any table across every tenant, and reach any bound infrastructure — regardless of what its own handler advertises.

Core enforces one startup check on this path: validateExtensions rejects (does not merely warn about) any raw routes entry that declares no authMiddleware/csrfMiddleware, so an unauthenticated raw route cannot boot. That check bounds who can call the route; it does not sandbox what the handler can do once called. Raw routes are also blocked from shadowing reserved core prefixes (/api/auth, /api/admin, /.well-known, …).

Guidance

  • Declare routes under extensionRoutes and let core wrap them. New extensions should have routes: [].
  • Use raw routes only for a handler that genuinely needs core internals, and treat it as core code for review purposes.
  • Operators: only load extensions you or your organisation control, and pin them by exact version. Extension code has no reduced privilege.
  • Other extension surfaces (hooks, strategies, crossTenantRead) run in-process too. crossTenantRead is validated against a core allow-list at startup, but a hook is ordinary trusted code.