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

@towerism/selfhost-kit

v0.4.2

Published

Shared, security-sensitive platform code for Towerism's self-hosted Nuxt 4 apps

Readme

selfhost-kit

Shared platform code for Towerism's self-hosted Nuxt 4 apps: play-pokemon-attendance-web and Tournament Genie.

It holds the security-sensitive infrastructure both apps need, so that there is one copy of it and a fix reaches both apps:

  • an AES-256-GCM vault for secrets stored in SQLite;
  • secret bootstrap (env first, else a file generated once under /data/secrets/) and the production launcher;
  • a pino logger with redaction, and request ids;
  • security headers and CSP, a rate limiter that knows about trusted proxies, and JSON-only and body-size guards;
  • one-time setup codes;
  • the container entrypoint (PUID/PGID, gosu, optional Litestream);
  • reusable image and release workflows.

It ships as one npm package, @towerism/selfhost-kit, with a framework-free core and h3/Nitro adapters on @towerism/selfhost-kit/nitro.

Status: K3 (ops assets) delivered. The framework-free core is available from @towerism/selfhost-kit: the vault, secret resolution, the runtime env and launcher, the logger with redaction and request ids, the CSP/header builder, the rate limiter and trusted proxies, and setup codes. @towerism/selfhost-kit/nitro has the h3 adapters: jsonOnly and bodySizeLimit middleware, the security-headers and request-log plugins, the enforceRateLimit guard and the JSON error handler. @towerism/selfhost-kit/testing has the vault and redaction contract suites, the v1 vault vectors, secret-dir fixtures, a fake clock, an in-memory Nitro-like h3TestApp, and the JSON-only, body-size and security-headers contract suites. The ops assets are in: the container entrypoint, the Litestream config and pinned installer (copied out with selfhost-kit docker-assets), the reusable app-image and app-release workflows, and the shared release config @towerism/selfhost-kit/release-config. See docs/ops-assets.md.

Install

pnpm add --save-exact @towerism/selfhost-kit

Requires Node 24.11 or later. The package is ESM only. h3 (for /nitro) and vitest plus h3 (for /testing) are optional peer dependencies. While the kit is in 0.x, pin an exact version: a minor release may break.

Security

To report a vulnerability, see SECURITY.md. Don't open a public issue.

Read first

  • Architecture: context, goals, the package layout, API sketches, the /data contract, how fixes reach both apps, the migration plan, risks and milestones.
  • Architecture Decision Records
  • Follow-up issues for the apps (drafts)
  • Ops assets: the Dockerfile lines, the caller workflow, the release config and the Renovate group an app needs
  • Releasing: how versions are published, the credentials involved (none stored), rollback, and what to do when a release fails

Development

pnpm install --frozen-lockfile
pnpm lint && pnpm typecheck && pnpm test   # test includes the coverage gate
pnpm build && pnpm check:package && pnpm test:package
pnpm test:entrypoint                       # Docker: builds the fixture image and runs the container tests
pnpm bench                                 # logger throughput, by hand; report it in PRs that touch logging

Commits follow Conventional Commits: they decide the next version.

Scope

This package serves the two apps above. It is public, but its API follows their needs, and semver promises cover only the documented API. It contains no secrets or deployment-specific values. Every key, token or address in its tests is synthetic.

License

MIT