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/core

v0.1.2

Published

Stampdown is a Markdown templating language, that is simple and extensible.

Downloads

7

Readme

Stampdown

Everyone loves Markdown! Stampdown is Markdown on steroids, making it usable in more places than ever before.

Stampdown is a simple Markdown templating language with a minimal, Handlebars‑style syntax. It uses a template and an input object to generate a Markdown document.

Features

  • Variables
  • Expressions
  • Control Statements
  • Partials
  • Custom Helpers & Plugins
  • Precompiler

How it works

Template (welcome.sdt):

# Welcome, {{user.name}}!

{{#if user.premium}}
**Premium Member**
{{else}}
Free Tier
{{/if}}

{{#each items}}
- {{this}}
{{/each}}

{{#*inline "footer"}}
---
Generated on {{#formatDate now "YYYY-MM-DD"/}}
{{/inline}}

{{> footer}}

Render code:

import { Stampdown } from '@stampdwn/core';
import { dateHelpersPlugin } from '@stampdwn/core/plugins';
import { readFileSync } from 'fs';

const engine = new Stampdown({ plugins: [dateHelpersPlugin] });
const src = readFileSync('welcome.sdt', 'utf-8');

const output = engine.render(src, {
  user: { name: 'Alice', premium: true },
  items: ['Getting Started Guide', 'FAQ', 'Release Notes'],
  now: new Date()
});

console.log(output);

Resulting Markdown:

# Welcome, Alice!

**Premium Member**

- Getting Started Guide
- FAQ
- Release Notes

---
Generated on 2025-11-21

Installation

npm install @stampdwn/core

Features

Variables

Assign and use variables inline (silent output):

{{ total = 0 }}
{{#each prices}}
  {{ total = total + this }}
{{/each}}
Total: {{ total }}

Built-in Helpers

Core block helpers:

{{#if premium}}
  **Premium**
{{else}}
  Standard
{{/if}}

{{#each items}}
  - {{this}}
{{/each}}

{{#with user}}
  Name: {{name}}
{{/with}}

{{#unless disabled}}
  Enabled
{{/unless}}

Built-in Plugins

Opt-in helper plugins for strings, math, dates, arrays, debug:

import { Stampdown } from '@stampdwn/core';
import { stringHelpersPlugin, mathHelpersPlugin } from '@stampdwn/core/plugins';

const sd = new Stampdown({
  plugins: [stringHelpersPlugin, mathHelpersPlugin]
});

const result = sd.render('{{#uppercase name/}} = {{#add a b/}}', {
  name: 'alice',
  a: 6,
  b: 7
});
console.log(result); // => ALICE = 13

Expressions

Comparison, logical operators, subexpressions:

{{#if (score >= 90) || (vip && score >= 80)}}
  High Score
{{else}}
  Regular
{{/if}}

Partials

Static, inline, and partial blocks:

{{#*inline "card"}}
  **{{title}}**

  {{content}}
{{/inline}}

{{> card title="Note" content="Remember to hydrate."}}

Precompiling

import { Precompiler, Stampdown } from '@stampdwn/core';

const pre = new Precompiler();
const compiled = pre.precompile('Hello {{name}}!', {
  templateId: 'greet',
  knownHelpers: 'all'
});

const fn = new Function('context', 'stampdown', compiled.code);
const sd = new Stampdown();
sd.registerPrecompiledTemplate('greet', fn);

const result = sd.renderPrecompiled('greet', { name: 'World' });
console.log(result); // => Hello World!

Custom Helpers

const sd = new Stampdown();

sd.registerHelper('repeat', (_ctx, _opts, text, times = 2) => {
  return text.repeat(Number(times));
});

const result = sd.render('{{#repeat word 3/}}', { word: 'Hi ' });
console.log(result); // => Hi Hi Hi

Custom Plugins

Bundle helpers & configuration:

import { createPlugin } from '@stampdwn/core';

const statsPlugin = createPlugin({
  name: 'stats',
  plugin: (sd) => {
    sd.registerHelper('avg', (_c, _o, ...nums) => {
      const n = nums.map(Number);
      return (n.reduce((a, b) => a + b, 0) / n.length).toFixed(2);
    });
  }
});

const sd = new Stampdown({ plugins: [statsPlugin] });
const result = sd.render('Avg: {{#avg 3 5 7/}}', {});
console.log(result); // => Avg: 5.00

API Docs

Full API reference: packages/core/docs/index.md

Related Packages

This package is part of the Stampdown ecosystem:

License

MIT