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

@bwilliamson/template-engine-cli

v0.0.4

Published

CLI for the secure templating engine

Readme

@bwilliamson/template-engine-cli

Command-line tool for rendering mergeEngine-style templates with JSON data.

Pre-1.0: Expect breaking changes in CLI flags and template syntax until 1.0.0. Pin exact versions and check release notes before upgrading.

Requires Node.js >= 22.12.

Install

npm install -g @bwilliamson/template-engine-cli

Usage

template-engine --template template.txt --data data.json
cat template.txt | template-engine --data data.json
template-engine --help

Options

| Flag | Required | Description | | ------------------- | -------- | -------------------------------------------- | | --data <file> | Yes | JSON file used as the template data context | | --template <file> | No | Template file; reads from stdin when omitted | | --help | No | Show usage |

Rendered output is written to stdout. Errors (including parse failures with source location) go to stderr.

Example

data.json

{ "name": "World" }

template.txt

Hello, <#name#>!
template-engine --template template.txt --data data.json
# Hello, World!

Template language

The CLI uses legacy syntax — the same language parsed by parseLegacy in @bwilliamson/template-engine-core.

| Construct | Syntax | Purpose | | ------------- | ------------------------- | ----------------------------------------- | | Variable | <#name#> | Insert a value from --data | | Loop | <~ ... <*> <[items]> ~> | Repeat for each array element | | Conditional | <~<+> ... <?cond?> ~> | Render one branch | | Function call | <{fn(...)}> | Not available in the CLI (empty registry) |

See the Template Language Reference for the complete guide.

Behavior notes

Stdin: The CLI reads the entire stdin stream before parsing. It does not wait for more input when a tag looks incomplete; if the stream closes mid-tag, parsing fails with a syntax error.

Functions: The CLI intentionally registers no template functions. For custom functions, use the core library in a host application.

Standalone executable

For environments without Node.js, build a single-file binary from the monorepo root:

pnpm --filter @bwilliamson/template-engine-cli run build:standalone:linux   # or :macos / :windows

Output lands in packages/template-engine-cli/dist/. See DEVELOPERS.md for release details.

Links