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

@junejs/juno

v0.2.2

Published

Juno — June's ergonomic data layer over the JuneDb contract. The default that ships with the agent-native magic (Tier 3).

Readme

@junejs/juno

June's ergonomic data layer — a typed table API over the JuneDb contract, so it runs over sqlite / D1 / Postgres alike. Optional Tier 3: a minimal app just uses the raw db resource (db.query(sql, params)); declare Juno to get the magic (auto-batch, auto-invalidation, compile-once). Depends on @junejs/core + @junejs/db (inward); the framework never imports Juno.

Use it

Opt in once, in june.config.ts:

import { defineJune } from "@junejs/core/config";
import { sqlite } from "@junejs/server";
import { junoDataLayer } from "@junejs/juno";

export default defineJune({ resources: { db: sqlite() }, dataLayer: junoDataLayer() });

Then, ambiently — no handle to thread, ctx stays identity-only; use inside a request (a loader/view/action):

import { table } from "@junejs/juno";
import { db } from "@junejs/server"; // the one canonical handle

await table("users").findBy({ email: "[email protected]" });         // point read (auto-batches)
await table("posts").all(
  { user_id: 7, created_at: { gte: cutoff }, title: { like: "%june%" } },
  { orderBy: { created_at: "desc" }, limit: 20, offset: 0 },
);
await table("users").upsert({ email: "[email protected]", name: "Ada" }, { onConflict: "email" });
await db.query("select * from users where age > ?", [18]);   // raw escape hatch (auto-tags)

Typed tables (zero config)

table("users") infers its row — the table name autocompletes, columns and their types flow through findBy / all / where / orderBy — with no inline generic. Run it once and after every migration:

june db types   # introspects the migrated db → writes db/schema.d.ts

That file is a declare module "@junejs/juno" augmentation generated from your SQL schema (db/migrations/), so types can't drift from the database and you maintain no schema DSL. Without it, table() is still fully usable — it just returns the untyped Row (or pass an inline generic: table<User>("users")).

Non-obvious facts (the easy-to-get-wrong bits)

The API shape is self-explanatory; these are the things models and humans get backwards. High-signal on purpose — read these, skip re-deriving the obvious.

  • Write the naive thing — the automatic layer makes it fast/correct. Don't hand-roll caching or batching loops on top; that's what Juno is for.
  • findBy / all by a single column auto-batch per request. Naive per-component reads coalesce into one where col in (...) — do NOT manually collect ids to batch.
  • Use upsert(values, { onConflict }) — atomic, one round trip, returns the row. NOT findBy-then-insert (an extra round trip and a race).
  • Auto-invalidation fires at the ACTION boundary, not on a write. A mutation must be a defineAction; a direct insert/update outside an action invalidates no cache(). Don't expect a bare write to refresh a cached read.
  • On D1 / edge, round trips dominate — not the engine. Auto-batch kills sequential N+1 (the catastrophe). Versus concurrent reads the win is modest — concurrency already hides latency. Never go sequential; don't over-credit batch-vs-concurrent.
  • OR and joins → the raw db escape hatch. all() covers AND-of-operators (eq/ne/gt/gte/lt/lte/in/like) + order / limit / offset; raw SQL is first-class for the rest, and the canonical db auto-tags it (so a raw read inside cache() is invalidated by a write, not silently stale).

Tiers (Juno is optional)

The framework works fully without Juno. Tier 1 = bring your own (Prisma/Drizzle), untouched. Tier 2 = your ORM over the ambient db resource. Tier 3 = Juno (or any thin shim emitting recordTableRead/recordTableWrite) for the auto-invalidate / auto-batch / live-RSC magic. See docs/data-layer-boundary.md.

For tests or bring-your-own wiring, the explicit handle still works: const j = juno(someDb); await j.table("users").all().