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

mikel-cli

v0.33.0

Published

The cli tool for mikel templating.

Downloads

174

Readme

mikel-cli

npm version license

A command-line interface for the Mikel templating engine. This CLI tool allows you to render Mikel templates from the command line with support for data files, partials, helpers, and functions.

Installation

Install the tool using npm or yarn:

# Using npm
$ npm install mikel-cli mikel

# Using yarn
$ yarn add mikel-cli mikel

Note: You need to install both mikel-cli and mikel packages. The mikel package is a peer dependency that provides the core templating functionality.

Usage

Basic Usage

$ mikel <template> [options]

Options

| Option | Short | Description | |--------|-------|-------------| | --help | -h | Display help information | | --data <file> | -D | Path to JSON data file | | --output <file> | -o | Output file path | | --plugin <module> | -L | Load a Mikel plugin from a JavaScript module (can be used multiple times) | | --partial <file> | -P | Register a partial template (supports glob patterns, can be used multiple times) | | --helper <file> | -H | Register helper functions from a JavaScript module (supports glob patterns, can be used multiple times) | | --function <file> | -F | Register functions from a JavaScript module (supports glob patterns, can be used multiple times) |

Examples

Simple Template Rendering

Render a template and output to console:

mikel template.html

Using Data File

Render a template with data from a JSON file:

mikel template.html --data data.json

Output to File

Render template and save to an output file:

mikel template.html --data data.json --output dist/index.html

Using Partials

Register partial templates for reusable components:

mikel template.html --data data.json --partial header.html --partial footer.html --output dist/index.html

Using Helpers and Functions

Register custom helpers and functions from JavaScript modules:

mikel template.html --data data.json --helper helpers.js --function utils.js --output dist/index.html

Using Glob Patterns

Load multiple files using glob patterns:

# Load all HTML partials from a directory
mikel template.html --partial 'partials/*.html' --output dist/index.html

# Load all JavaScript helpers from a directory
mikel template.html --helper 'helpers/*.js' --output dist/index.html

# Load partials from subdirectories (recursive)
mikel template.html --partial 'components/**/*.html' --output dist/index.html

# Mix exact files and glob patterns
mikel template.html --partial header.html --partial 'components/*.html' --output dist/index.html

Complex Example

A complete example combining all features:

mikel src/template.html \
  --data src/data.json \
  --partial 'src/partials/*.html' \
  --partial 'src/components/**/*.html' \
  --helper 'src/helpers/*.js' \
  --function 'src/utils/*.js' \
  --output dist/index.html

Glob Pattern Support

The --partial, --helper, and --function options support glob patterns for loading multiple files at once:

| Pattern | Description | Example | |---------|-------------|---------| | *.ext | All files with extension in current directory | *.html, *.js | | dir/*.ext | All files with extension in specific directory | partials/*.html | | dir/**/*.ext | All files with extension in directory and subdirectories | components/**/*.html | | ? | Single character wildcard | file?.html |

Note: Glob patterns should be quoted to prevent shell expansion.

License

Licensed under the MIT License.