souhailaS / ejs-compile

EJS views compiler CLI and API. Compile views into a single ejs file.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

EJS Compiled Views

Installation

Install the module using locally using npm i ejsc-views or globally using npm i -g ejsc-views to use the CLI.

Usage

ejsc-views Compiles all <views_dir>/*.ejs files into a single <views_dir>/views.js file.

var ejsc = require('ejsc-views').compile() 

The views directory and the output directory can be configured in compile()

compile(views_dir = "views", output_dir = "public/js", details = false)

If you are using ES6 modules you can import the module using:

import { compile } from 'ejsc-views'

To use globally you can install ejsc-views using the command: npm i -g ejsc-views The CLI options are:

Usage: ejsc [options]

Compile all views/*.ejs files into a single /public/js/views.js file

Options:
  -V, --version              output the version number
  -v, --views <views_dir>    views directory (default: "views")
  -o, --output <output_dir>  output directory (default: "public/js")
  -d, --details              display the compiled views
  -h, --help                 display help for command

About

EJS views compiler CLI and API. Compile views into a single ejs file.


Languages

Language:JavaScript 100.0%