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

@stampdwn/cli

v0.1.2

Published

Command-line interface for Stampdown

Readme

Stampdown CLI

Command-line interface for rendering and precompiling Stampdown templates.

The package installs the stampdown binary.

Installation

npm install -g @stampdwn/cli

Overview

The CLI has two modes:

  • Render mode is the default and processes one or more templates into Markdown output.
  • Precompile mode is enabled with --precompile and turns templates into optimized JavaScript bundles.

Render Mode

# Render a template with a JSON data file
stampdown -D data.json template.sdt

# Render with inline JSON data
stampdown -D '{"name":"World"}' template.sdt

# Register partials and helpers from globs
stampdown -P "partials/*.sdt" -H "helpers/*.js" -D data.json template.sdt

# Write rendered output into a directory with a custom extension
stampdown -D data.json -o dist -e html template.sdt

# Write rendered output to stdout
stampdown -D data.json -s template.sdt

# Read data from stdin
echo '{"name":"Alice"}' | stampdown -i template.sdt

Render Options

  • -D, --data <glob|json>... Parse data from a file or inline JSON
  • -P, --partial <glob>... Register partial templates from one or more globs
  • -H, --helper <glob>... Register helper modules from one or more globs
  • -o, --output <directory> Output directory for rendered files
  • -e, --extension <ext> Output extension for generated files (default: md)
  • -s, --stdout Output rendered content to stdout
  • -i, --stdin Read JSON data from stdin
  • --verbose Enable verbose logging

Precompile Mode

# Precompile all templates matched by a glob
stampdown --precompile --input "templates/**/*.sdt" -o dist

# Change output format
stampdown --precompile --input "templates/**/*.sdt" -o dist -f cjs
stampdown --precompile --input "templates/**/*.sdt" -o dist -f json

# Generate source maps
stampdown --precompile --input "templates/**/*.sdt" -o dist --source-map

# Restrict known helpers for tree-shaking
stampdown --precompile --input "templates/**/*.sdt" -k "if,each,with"

# Enable strict helper validation
stampdown --precompile --input "templates/**/*.sdt" --strict

Precompile Options

  • --precompile Enable precompile mode
  • --input <glob> Input file or glob pattern
  • -o, --output <dir> Output directory (default: ./precompiled)
  • -f, --format <format> Output format: esm, cjs, or json (default: esm)
  • -k, --known-helpers <list> Comma-separated list of known helpers or all
  • --strict Error on unknown helpers
  • -w, --watch Watch matched files and rebuild on changes
  • -m, --source-map Generate source maps
  • --verbose Enable verbose logging

Helper Modules

Helper files can export a single function or named helper functions. Pass them with -H or --helper.

// helpers.js
module.exports = {
  formatDate: (_context, _options, value) => new Date(value).toISOString().slice(0, 10),
  repeat: (_context, _options, text, count = 2) => String(text).repeat(Number(count)),
};
stampdown -H ./helpers.js -D data.json template.sdt

Output Files

  • Render mode writes one output file per input template unless --stdout is used.
  • Precompile mode writes a single bundle file into the output directory:
    • templates.mjs for esm
    • templates.cjs for cjs
    • templates.json for json

API Docs

Full API reference: docs/index.md

Related Packages

License

MIT