Skip to content
/ ejss Public

Tools to convert EJS to HTML with detailed options.

License

Notifications You must be signed in to change notification settings

isaxxx/ejss

Repository files navigation

ejss

Tools to convert EJS to HTML with detailed options.

NPM Build Status MIT License

Installation

NPM

$ npm install ejss --save

Usage

CLI

Options:
  --src           src files path pattern. [string] [default: './src/ejs/**/*.ejs']
  --dest          dest directory path. [string] [default: './dest/']
  --data          data json file path. [string] [default: './src/ejs-data.json']
  --compression   whether to compression. [bool] [default: false]
  --lint          htmlhint config file path. [string] [default: '']
  --version, -v   show this version. [boolean]
  --help, -h      show this help. [boolean]
$ ejss --src ./src/ejs/**/*.ejs --dest ./dest/ --data ./src/ejs/data.json --compression true

JavaScript

ejss({
  src: './src/ejs/**/*.ejs',
  dest: './dest/',
  data: './src/ejs-data.json',
  compression: false,
  lint: './.htmlhintrc.json'
}).then(() => {
  console.log('Complete!!');
});

JSON

{
  "common": {
    "description": "dummy text."
  },
  "page": {
    "/index.html": {
      "title": "Index"
    },
    "/about.html": {
      "title": "About"
    }
  }
}

EJS

/index.ejs

<html>
  <h1><%= page.title %></h1>
  <p><%= common.description %></p>
</html>

<!--
<html>
  <h1>Index</h1>
  <p>dummy text.</p>
</html>
-->

/about.ejs

<html>
  <h1><%= page.title %></h1>
  <p><%= common.description %></p>
</html>

<!--
<html>
  <h1>About</h1>
  <p>dummy text.</p>
</html>
-->

About

Tools to convert EJS to HTML with detailed options.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published