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

@hjoncour/simpleblog

v0.2.1

Published

Portable collection logic and a React rich-content renderer for blogs and project showcases.

Downloads

64

Readme

simpleblog

simpleblog is a small ESM-first library for sites that keep their content in local JSON but want reusable collection logic and a portable React renderer for rich content blocks.

It is designed for setups like:

  • content stays inside the app repo
  • JSON remains simple and ad hoc
  • routing and page shells stay app-specific
  • query logic and rich-content rendering move into a shared package

Install

npm install simpleblog

The core package works without React. simpleblog/react expects react >= 18.

Core Usage

import {createCollection} from 'simpleblog';

const posts = createCollection({
  name: 'posts',
  identity: 'slug',
  load: async (locale: string) => {
    const module = await import(`./content/${locale}/posts.json`);
    return module.default;
  },
  defaultSort: {by: 'date', direction: 'desc'},
  recentSort: {by: 'date', direction: 'desc'},
  searchFields: ['title', 'preview', 'tags', 'content'],
  defaultTagMode: 'or',
});

const allPosts = await posts.list({locale: 'en'});
const recentPosts = await posts.recent({locale: 'en', limit: 4});
const currentPost = await posts.get('hello-world', {locale: 'en'});

React Renderer

Built-in blocks can stay ad hoc:

[
  {"h2": "Hello"},
  {"p": "Lorem ipsum dolor sit amet.\n[Read more](https://example.com)"},
  {"img": "https://picsum.photos/1200/600"}
]

Custom components use an explicit shape:

[
  {
    "component": "demoCallout",
    "props": {
      "title": "Lorem ipsum",
      "body": "Dolor sit amet"
    },
    "presentation": {
      "className": "my-callout",
      "style": {
        "marginTop": "1.5rem"
      }
    }
  }
]
import {RichContentRenderer, createComponentRegistry} from 'simpleblog/react';

const components = createComponentRegistry({
  demoCallout: DemoCallout,
});

<RichContentRenderer content={post.content} components={components} />;

Styling

Styling merges in this order:

  1. library defaults
  2. app-level theme overrides
  3. per-block presentation for custom components or className / style for ad hoc built-ins

The renderer supports both className and inline style.

HTML Safety

HTML is sanitized by default. Trusted HTML is available via htmlMode="trusted" when the content source is fully trusted.

Examples

Example JSON lives in examples/posts.en.json and examples/projects.en.json.

Automated Releases

The GitHub Actions workflow in .github/workflows/release.yaml publishes on pushes to master when the version in package.json has changed.

It assumes your existing versioning flow already updates both package.json and ssmver.toml. The workflow validates that those versions match, skips publish when the version did not change, and skips republishing if that version is already on npm.

To enable publishing:

  1. In npm package settings, add a trusted publisher for this GitHub repository and .github/workflows/release.yaml.