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

@backendfree/cms

v0.2.0

Published

Typed reads for published pages: the content half of a BackendFree project.

Readme

@backendfree/cms

Pages, typed: what is published, or with a test key the drafts. A publishable key is enough for the pages: nothing there is private, it is what the website shows. Reading the image library takes a secret key (see Images).

npm install @backendfree/core @backendfree/cms
import { Client } from '@backendfree/core';
import { Cms, firstSection, sectionsOfType } from '@backendfree/cms';

const cms = new Cms(new Client({ origin: 'https://backendfree.com', key: 'pk_live_...' }));

const home = await cms.page('home');
const hero = firstSection(home, 'hero');
const blocks = sectionsOfType(home, 'text');

Everything here reads. Content is edited in the dashboard and published from there, and an API that could write it would be a second way to change a live site.

Sections are per project

A page is a list of sections, and what section types exist is decided per project in the dashboard: hero, services, faq, or whatever you defined. So Section is { type: string, ...fields } and narrowing it is your job.

The standard types every project starts with, each field's key, kind and whether it is required, are listed at backendfree.com/docs/sections.

interface Hero {
  type: 'hero';
  headingLead: string;
  headingAccent: string;
  ctaPrimary: { label: string; href: string };
}

const hero = firstSection<Hero>(home, 'hero');

A section of a type your build has never heard of is skipped rather than rendered wrongly, so you can add one to the schema before the frontend learns it.

Field values are the seven kinds and nothing else: a string, a paragraph, a list of strings, a {label, href} link, a boolean, an image, or a list of groups of those. That ceiling is deliberate.

Images

An image field arrives as { id, url, width, height, alt }, an image of the website's library as it is now, or null when none is chosen or the image was deleted since. alt may be empty. The type is ImageValue.

import type { ImageValue } from '@backendfree/cms';

interface Team {
  type: 'team';
  heading: string;
  photo: ImageValue;
}

const team = firstSection<Team>(home, 'team');
if (team?.photo) {
  const { url, width, height, alt } = team.photo;
}

The library itself is read with a secret key, from your server: images() lists it newest first and image(id) reads one. Both throw before asking when the client holds a publishable key, since the library holds images no page shows yet. Images are uploaded in the dashboard, on the Media screen.

const server = new Cms(new Client({ origin: 'https://backendfree.com', key: process.env.BACKENDFREE_SECRET_KEY! }));

const { results } = await server.images();
const one = await server.image(results[0].id);

Drafts

With a live key, a draft, a page in another language, and a page that never existed all answer the same 404. That is on purpose: the API is not a way to discover what a client is still working on.

With a test key the drafts are the content: every page as it was last saved, published or not, so a staging site shows a change before it goes live. version and published_at are null on a page never published. Anybody who can open a site using a test key can read the unpublished work through it.

import { isNotFound } from '@backendfree/core';

const page = await cms.page(slug).catch((error) => {
  if (isNotFound(error)) return null;
  throw error;
});

Knowing when to rebuild

manifest() is one cheap call whose cache_version changes on every publish, and with a test key whenever a draft is saved. Keep the last number you saw and refetch only when it moves, rather than refetching everything on a timer.

const { cache_version } = await cms.manifest();
if (cache_version !== lastSeen) { /* rebuild */ }

It also says which locales have something published, and which the project is set up to publish, which are not the same list.