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

better-cms

v0.5.0

Published

Drop-in headless CMS for SvelteKit. BYO database, BYO storage. Single install, subpath imports.

Readme

better-cms

Drop-in headless CMS. BYO database, BYO storage. SvelteKit today, React/Next planned. Inspired by better-auth.

Install

bun add better-cms

That's the only line. Subpath imports work via package.json#exports — peer deps are optional, so you only install what you use.

# pick one DB driver
bun add @libsql/client
# pick one ORM (optional — libsql adapter works without)
bun add drizzle-orm

# framework
bun add @sveltejs/kit svelte

# CLI (dev-only)
bun add -D @better-cms/cli

Define content

Schema-first: write a zod schema, the CMS derives fields, validators and the admin form from it.

// src/lib/cms/server/cms.ts  (server-only: any `server/` path segment is guarded by SvelteKit)
import { createCms } from 'better-cms/sveltekit/server';
import { libsqlAdapter } from 'better-cms/adapters/libsql';
import { s3Media } from 'better-cms/media/s3';
import { image, richText, slug } from 'better-cms/zod';
import { z } from 'zod';

export const cms = createCms({
  collections: ({ collection, singleton }) => ({
    posts: collection({
      label: 'Blog posts',
      schema: z.object({
        title: z.string().min(1).max(120).meta({ label: 'Headline' }),
        slug: slug(),
        body: richText(),
        cover: image().optional(),
        published: z.boolean().default(false),
      }),
      admin: { title: 'title', sort: { field: 'createdAt', direction: 'desc' } },
    }),
    settings: singleton({
      schema: z.object({ siteTitle: z.string(), logo: image().optional() }),
    }),
  }),
  adapter: libsqlAdapter({ url: process.env.DATABASE_URL!, authToken: process.env.DATABASE_AUTH_TOKEN }),
  media: s3Media({ bucket: process.env.S3_BUCKET!, /* ... */ }),
  auth: { context: async () => ({ user: { id: 'dev', role: 'admin' as const } }) },
});

export type Cms = typeof cms;

Wire SvelteKit

// src/hooks.server.ts
import { cmsHandle } from 'better-cms/sveltekit/server';
import { cms } from '#lib/cms/server/cms.ts';
export const handle = cmsHandle(cms);

Drop-in admin UI

The admin takes a client, not a config. It reads field metadata from GET /api/cms/_meta.

// src/lib/cms/client.ts
import { createCmsClient } from 'better-cms/sveltekit';
import type { Cms } from './server/cms';
export const cmsClient = createCmsClient<Cms>({ basePath: '/api/cms' });
<!-- src/routes/cms/+page.svelte -->
<script>
  import { CmsAdmin } from 'better-cms/admin';
  import { cmsClient } from '#lib/cms/client.ts';
</script>
<CmsAdmin client={cmsClient} />

Database schema

libsqlAdapter creates tables and adds new columns on startup. With drizzleAdapter, generate the schema and let drizzle-kit migrate:

bunx -p @better-cms/cli bcms generate
bunx drizzle-kit push

Subpath map

| Import | What | |---|---| | better-cms | Core runtime + types (createCMS, RowOf, CollectionDef, ops). | | better-cms/zod | Schema-first DSL — collection, singleton, richText, image, slug, relation. | | better-cms/adapters/libsql | Direct libsql ContentStore. Creates tables and adds missing columns on init. | | better-cms/adapters/drizzle | Drizzle ContentStore. drizzle-kit owns DDL. | | better-cms/media/s3 | S3-compatible MediaStore (R2/Wasabi/B2/MinIO/AWS). | | better-cms/sveltekit | Browser-safe: createCmsClient (admin UI + external clients). | | better-cms/sveltekit/server | Server-only: createCms, cmsHandle. | | better-cms/auth | Password plugin, signed-cookie sessions, rate limiting, Turnstile. | | better-cms/admin | <CmsAdmin> and <FieldEditor> Svelte 5 components. | | better-cms/types | Re-export of every public type. |

CLI

bunx -p @better-cms/cli bcms init        # scaffold cms.config.ts + .env.example
bunx -p @better-cms/cli bcms generate    # emit drizzle schema file from cms.config
bunx -p @better-cms/cli bcms generate --target=types   # emit TS interfaces
bunx -p @better-cms/cli bcms mcp         # boot stdio MCP server (Claude Code, Claude Desktop)

Status

Pre-alpha. Architecture in flux.