ejsrun

0.1.0 • Public • Published

ejsrun 🏃🏻‍♂️

A command line runner for EJS - similar to ejs-cli

I wrote this (quickly) because I needed to create templates for a project that merged various options before sending to EJS for processing.

Also, I prefer to keep my options in an HJSON file.

Features

  • Allows multiple -O options with parameters and merges them to pass to the ejs processor. This allows you to have various levels of providing values (think default values and overrides, and/or configuration values and override on command line, etc.)
  • Can use with HJSON files (my preferred configuration file format)
  • Specify multiple ejs files on the command line (or even a glob) and output files are created with same name (and .html extension).

Example

ejsrun pages/*.ejs -O defaults.json -O config.hjson -O "{\"develop\":true}"

The above example processes all .ejs pages within the pages directory and creates files with the same names and .html extension after processing with EJS. The data used in the template substitutions is a combination of the JSON from defaults.json, with overrides from the config.hjson and a final override of develop: true.

Readme

Keywords

none

Package Sidebar

Install

npm i ejsrun

Weekly Downloads

1

Version

0.1.0

License

MIT

Unpacked Size

51.3 kB

Total Files

6

Last publish

Collaborators

  • bluejava