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

@getstrata/core

v1.1.5

Published

Strata Bun framework public API

Readme

@getstrata/core

Runtime library for Strata apps: HTTP, auth, database, queue, mail, and security. Requires Bun (tested on 1.4.x).

Generate an app rather than wiring this by hand:

bunx create-strata my-app

Import subpaths, not the root

Apps, and anything they import, should use subpaths:

import { createAuthMiddleware } from "@getstrata/core/http/authMiddleware";
import { bindDatabaseConnection } from "@getstrata/core/database/bindConnection";
import { BaseRepository } from "@getstrata/core/database/baseRepository";
import { FormRequest } from "@getstrata/core/http/formRequest";
import { Policy } from "@getstrata/core/auth/policy";
import { withErrorHandling } from "@getstrata/core/http/response";
import { ValidationError } from "@getstrata/core/errors/http";
import type { Migration } from "@getstrata/core/database/migrations/types";

The root @getstrata/core import resolves, but nothing stops you from ending up with two copies of process-wide state: the database pool, the dialect override, async-local auth and tenant context, and the HttpError base class used with instanceof. Some subpaths re-export the main bundle for exactly that reason. Prefer subpaths everywhere and the problem does not arise.

Database

Set DATABASE_URL before the first query; the connection is created lazily.

process.env.DATABASE_URL ??= "postgresql://postgres:postgres@localhost:5432/myapp";

The engine is your choice, and an app should have one primary engine. Postgres apps use Bun's built-in Bun.sql through createBunSqlPool(), then registerDefaultDatabasePool() and bindDatabaseConnection(); bindBunSql() registers both. SQLite and MySQL register through database/sqliteConnection and database/mysqlConnection, or registerNamedConnection from database/namedConnections.

orderBy takes { column, direction } objects or column shorthand such as { published_at: "desc" }. { ilike } uses the value as-is, so pass %term% yourself.

Full-text tsMatch is PostgreSQL only.

eta and mysql2 are optional peers. Core loads them with import() the first time you render a view or open a MySQL connection. SQLite and Postgres apps do not install mysql2. Generated apps add eta because the welcome page uses it. MySQL apps also add mysql2. The MySQL helpers are exported from @getstrata/core/database/mysqlConnection, @getstrata/core/database, and the root barrel; importing any of them does not install mysql2, and apps should prefer the subpath as with every other core module. The subpath re-exports the barrel, so both share one lazy mysql2 load.

Views

.eta files are HTML plus Eta tags (<% %>, <%= %>, <%~ include() %>). Pug-style class or id shorthand such as section.section throws at render time and names the offending template.

Admin and queue helpers

  • AdminResourceRegistry, formatAdminValue: read-only resource browsers
  • createFailedJobService, FailedJobService.delete(): failed job persistence and cleanup
  • runQueueJob, jobRegistry: dispatch retried jobs from admin UIs

Generated apps do not include an admin dashboard, and the registry is optional.

Docs

Contributing to the framework itself: CONTRIBUTING.md.