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

@hypertext-md/spec

v0.4.1

Published

Machine-readable block definitions for Hypertext Markdown (HTMD)

Readme

@hypertext-md/spec

Machine-readable block definitions for Hypertext Markdown.

Why this repo

This repo is the source of truth for all LayoutMD block types: what attributes and fields a block type has, what a valid example looks like, and whether it's already implemented or still planned. Everywhere else that needs to know something about blocks — the TypeScript types of @hypertext-md/parser, the README table of hypertext-md.com, the parser code itself — derives from these definitions instead of duplicating them redundantly.

Install

npm install @hypertext-md/spec

ESM only, no runtime dependencies. TypeScript types are included.

import spec, { blocks, byKeyword } from '@hypertext-md/spec';

blocks.filter(b => b.status === 'implemented');
byKeyword.hero.fields;

The raw JSON is available on subpaths for consumers that want the files rather than the module:

import index from '@hypertext-md/spec/index.json' with { type: 'json' };
import schema from '@hypertext-md/spec/schema' with { type: 'json' };
import hero from '@hypertext-md/spec/blocks/hero.json' with { type: 'json' };

dist/index.js inlines the spec data rather than importing the JSON, so it also works in browser bundles without import attributes.

Structure

htmd-spec/
├── schema/
│   └── block-spec.schema.json   # JSON Schema every block spec must satisfy
├── blocks/
│   ├── hero.json
│   ├── split.json
│   ├── grid.json
│   ├── …                         # one file per block keyword
│   └── gallery.json              # status: "planned" — not yet implemented
├── types/
│   └── index.d.ts               # published types — mirrors the schema
├── dist/                        # generated: index.json + index.js
└── scripts/
    └── validate-and-build-index.mjs

Adding a block spec

  1. Create blocks/<keyword>.json — the filename must exactly match the keyword field
  2. Validate against schema/block-spec.schema.json: npm run validate
  3. Set status: "planned" as long as @hypertext-md/parser doesn't parse the block yet — only set status: "implemented" after it's built there
  4. A complete, runnable example is mandatory — it's rendered automatically on the syntax reference page of hypertext-md.com

Validation

npm install
npm run validate

Checks every file under blocks/ against the schema and generates everything under dist/ — a sorted overall list of all specs (implemented ones first), as JSON and ESM. The output is committed and shipped in the npm package; npm publish regenerates it via prepublishOnly. Builds are deterministic, so regenerating without a spec change produces no diff.

index.json is additionally published by the pipeline as a Generic Package and can be loaded by other repos without an npm dependency on htmd-spec itself:

https://gitlab.com/api/v4/projects/83926058/packages/generic/htmd-spec/latest/index.json

Consumers

  • hypertext-md.com — generates the syntax reference page (/syntax) from index.json, one section per block, including a rendered live example
  • @hypertext-md/parser (planned) — could use index.json at runtime or build time to give more targeted warnings for unknown block keywords ("did you mean 'grid'?") instead of just a generic "unknown block"
  • htmd-vscode (planned) — autocompletion and hover docs in the editor, fed from the same source. keyword drives completion items, summary/example the hover content, attrs and fields the per-block detail

Status values

implemented — built in @hypertext-md/parser and covered by the default renderer. planned — specified, not yet implemented. draft — under discussion, structure may still change. deprecated — sunset, will be removed in a future major version.