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

@weave-md/basic

v0.5.0

Published

Reference implementation of Weave Markdown - CLI, renderer, and exporter

Downloads

134

Readme

@weave-md/basic

CLI and exporter for Weave Markdown.

Installation

pnpm add @weave-md/basic

CLI

Export

weave-md-basic export html --entry=intro   # Export to HTML
weave-md-basic export ast                  # Export to JSON AST

HTML entry point: If exactly one .md file exists in the root directory, --entry is auto-detected:

weave-md-basic export html

Output: Use --out to specify output directory:

weave-md-basic export html --out=./build

Validate

weave-md-basic validate              # Check for errors
weave-md-basic validate --strict     # Exit 1 on errors
weave-md-basic validate --json       # JSON output

Help

weave-md-basic help

Programmatic Usage

import { loadWorkspace, exportToStaticHtml, parseToMdast } from '@weave-md/basic';

// Load sections from directory
const { sections, rawContent } = await loadWorkspace('./content');

// Parse to mdast trees
const trees = new Map();
for (const section of sections) {
  const content = rawContent.get(section.id);
  if (content) {
    const { tree } = parseToMdast(content);
    trees.set(section.id, tree);
  }
}

// Export to static HTML
const html = exportToStaticHtml(sections, trees, { title: 'My Document' });

API

loadWorkspace(path, options?)

Load sections from .md files with valid frontmatter. Recursively scans directories and subfolders.

  • options.files - Load specific files only
  • options.extensions - File extensions (default: ['.md'])
  • options.exclude - Directories to skip (default: ['node_modules', '.git'])

Returns { sections, filePaths, rawContent }.

exportToStaticHtml(sections, trees, options?)

Generate a complete HTML document with footnotes and overlay support.

  • options.title - Document title
  • options.entry - Entry section ID (only renders this section and its references)

Display Modes

  • footnote (default) - Numbered references at bottom
  • inline - Expandable content inserted after paragraph
  • overlay - Click to show tooltip preview

Nesting Rules

This renderer enforces the following nesting restrictions:

| Context | Allowed Node Links | |---------|-------------------| | Main content | footnote, inline, overlay | | Inside footnote | overlay only | | Inside inline | overlay only | | Inside overlay | none (plain text) |

Node links inside footnotes and inline content are converted to overlays. Overlays cannot contain further interactive links.

License

MIT