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 🙏

© 2025 – Pkg Stats / Ryan Hefner

ejs-cli-extended

v0.1.1

Published

Extended EJS CLI tool with directory processing and watch functionality

Downloads

9

Readme

EJS CLI Extended

Extended EJS CLI tool with directory processing and watch functionality.

CI npm

Features

  • 🗂️ Directory Processing: Process all .ejs files in a directory recursively
  • 👀 Watch Mode: Automatically recompile templates when files change
  • Concurrent Processing: Multiple templates can be processed simultaneously
  • 🔄 100% Compatible: Directly executes the official EJS CLI, ensuring perfect compatibility

Installation

Global Installation

npm install -g ejs-cli-extended

Local Installation

npm install ejs-cli-extended

When installed locally, you can run it with:

# Using npx
npx ejsc src:dist

# Using npm scripts
npm exec ejsc src:dist

# Or add to your package.json scripts
"scripts": {
  "build": "ejsc src:dist"
}

Usage

Single File Mode

Process a single EJS template file:

ejsc template.ejs -o output.html
ejsc template.ejs -f data.json -o output.html

Directory Mode

Process all .ejs files in a directory:

ejsc src:dist
ejsc templates:build -f config.json

Watch Mode

Continuously watch for changes and recompile:

# Single file
ejsc template.ejs -o output.html --watch

# Directory
ejsc src:dist --watch

Options

Standard EJS CLI Options

All standard EJS CLI options are supported. For complete documentation, see the official EJS CLI repository.

Extended Options

  • --watch - Watch for changes and recompile automatically
  • input-dir:output-dir - Process directory (replaces single file path)

Examples

Basic Directory Processing

# Process all .ejs files in 'templates' directory
# Output to 'dist' directory
ejsc templates:dist

With Data File

# Use JSON data file for template variables
ejsc src:build -f data.json

Watch Mode

# Watch for changes and auto-recompile
ejsc templates:dist --watch -f config.json

Directory Structure

When using directory mode, the tool:

  1. Recursively finds all .ejs files in the input directory
  2. Maintains the same directory structure in the output
  3. Converts .ejs extensions to .html
  4. Creates output directories as needed

Example:

src/
├── index.ejs           → dist/index.html
├── pages/
│   ├── about.ejs       → dist/pages/about.html
│   └── contact.ejs     → dist/pages/contact.html
└── components/
    └── header.ejs      → dist/components/header.html

Complete EJS CLI Compatibility

This tool directly executes the official EJS CLI, ensuring 100% compatibility. All EJS CLI features are supported, including:

  • All command-line options and flags
  • Data input via files, command line, or stdin pipe
  • Template preprocessing and compilation
  • Custom delimiters and configurations
# All these work exactly like the official EJS CLI
ejsc template.ejs -o output.html
ejsc template.ejs -f data.json -o output.html
echo '{"name": "World"}' | ejsc template.ejs -o output.html
ejsc template.ejs -m $ -p [ -c ] -o output.html

You can use this tool as a complete drop-in replacement for the official EJS CLI.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.