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

@kimzuni/templify-cli

v1.1.0

Published

CLI for the @kimzuni/templify, a flexible template string processor.

Readme

@kimzuni/templify-cli

NPM version codecov

CLI for the @kimzuni/templify a flexible template string processor.

It supports customizable template delimiters, spacing rules, and fallback values.

Installation

npm install -g @kimzuni/templify-cli

Example

templify "{ key1 }, { key2 }!" key1=hello key2=world
# hello, world!

# or (alias)
tply "{ key1 }, { key2 }!" key1=hello key2=world
# hello, world!

templify -h # or --help

templify -v # or --version

Options

All options except Template are optional.

Subcommand

[!IMPORTANT] The subcommand must be provided as the first argument. Otherwise, it is treated as a template string or render data.

Choices: render, keys, placeholders, fields, groups Default: render

See the @kimzuni/templify Example for subcommands behavior.

Template

The template string to render. A template is required and can be provided in several ways.

Template resolution order:

  1. piped or redirected input
  2. inline template option: -t, --template
  3. template file option: -T, --template-file
  4. positional argument: TEMPLATE
    • If a template has already been resolved, the value is treated as KEY=VALUE render data.
  5. wait for input from stdin (TTY only)
echo template string | templify

templify < template-file.txt

templify << EOF
template string
EOF

templify <<< "template string"

templify "template string"

templify -t "template string" # or --template

templify -T template-file.txt # or --template-file

templify
# Press Ctrl+d to signal end-of-file (EOF).

KEY=VALUE(Render Data)

[!NOTE] render-only option

Key-value pairs used as render data. This data forms the rendering context for the template.

Merge order (later sources override earlier ones):

  1. environment variables option: -e, --from-env
  2. data file option: -D, --data-file
  3. positional argument: [KEY=VALUE...]
echo -n "Hello, { USER }!" | templify
# Hello, { USER }!

echo -n "Hello, { USER }!" | templify XXX=USER_1
# Hello, { USER }!

echo -n "Hello, { USER }!" | templify USER=USER_1
# Hello, USER_1!

echo -n "Hello, { USER }!" | templify -e
# Hello, kimzuni!

echo "USER=USER_1" > test.env
echo -n "Hello, { USER }!" | templify -e -D test.env
# Hello, USER_1!

echo '{ "USER": "USER_2" }' > test.json
echo -n "Hello, { USER }!" | templify -e -D test.json
# Hello, USER_2!

echo -n "Hello, { USER }!" | templify -e -D test.json USER=Guest
# Hello, Guest!

--no-stdin

Disable reading from standard input.

echo -n "{ key1 }, { key2 }!" | templify key1=hello key2=world
# hello, world!

echo -n "{ key1 }, { key2 }!" | templify key1=hello key2=world --no-stdin
# key1=hello

--no-validate

Disable validation of option usage and conflict checks.

# Conflict between stdin and -T(--template-file) option
echo -n "{ key1 }, { key2 }!" | templify -T file.txt key1=hello key2=world
# Error: ...

echo -n "{ key1 }, { key2 }!" | templify -T file.txt key1=hello key2=world --no-validate
# hello, world!

# --compact is non-render option
echo -n "{ key1 }, { key2 }!" | templify key1=hello key2=world --compact
# Error: ...

echo -n "{ key1 }, { key2 }!" | templify key1=hello key2=world --compact --no-validate
# hello, world!

--compact

[!NOTE] non-render option

Output compact JSON without indentation or newlines.

templify groups "{ key } / {key1} / { key} / {key1}"
# {
#   key: [ "{ key }", "{ key}" ],
#   key1: [ "{key1}" ],
# }

templify groups "{ key } / {key1} / { key} / {key1}" --compact
# {"key":["{ key }","{ key}"],"key1":["{key1}"]}

--key-pattern

Select a predefined key pattern for placeholders.

<name> must be one of the values defined in KEY_PATTERNS.

echo "{ key1 } / { key2[0].key3 }" | templify keys --key-pattern default
# [ "key1" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --key-pattern deep
# [ "key1", "key2[0].key3" ]

--depth

[!NOTE] While --depth is a render-only option in the @kimzuni/templify, the CLI treats it as a common option.

Controls how deeply nested values are resolved, and is also used by the CLI to infer key patterns for nested placeholders.

echo "{ key1 } / { key2[0].key3 }" | templify keys
# [ "key1" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --depth 1
# [ "key1" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --depth 1 --key-pattern deep
# [ "key1", "key2[0].key3" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --depth -1 # --key-pattern deep
# [ "key1", "key2[0].key3" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --depth -1 --key-pattern default
# [ "key1" ]

echo "{ key1 } / { key2[0].key3 }" | templify keys --depth -1 --key "\\w+"
# [ "key1" ]

templify Options

The following options are forwarded to the @kimzuni/templify Options.

| Short | Long | |-------|--------------------| | -k | --key | | -o | --open | | -c | --close | | - | --spacing-size | | - | --spacing-strict | | -f | --fallback | | - | --depth |