Express Generator Without Jade

Richard WU picture Richard WU · Jun 4, 2015 · Viewed 13.2k times · Source

I am trying to generate an express skeleton, using the express generator. So it would be this:

$ npm install express-generator -g

However, it adds a bunch of automatic jade files.

I was wondering if there was a way to get rid of those jade files and just using html with the express generator

Thanks!

Answer

Harsha Kasturi picture Harsha Kasturi · Jan 11, 2016

Try running this command in command prompt:

express --help

It will give you the express generator help:

  Usage: express [options] [dir]

  Options:

    -h, --help          output usage information
        --version       output the version number
    -e, --ejs           add ejs engine support
        --hbs           add handlebars engine support
        --pug           add pug engine support
    -H, --hogan         add hogan.js engine support
        --no-view       generate without view engine
    -v, --view <engine> add view <engine> support (ejs|hbs|hjs|jade|pug|twig|vash) (defaults to jade)
    -c, --css <engine>  add stylesheet <engine> support (less|stylus|compass|sass) (defaults to plain css)
        --git           add .gitignore
    -f, --force         force on non-empty directory

Source: https://expressjs.com/en/starter/generator.html

The above options give you the list of "view engines".

Now, simply type:

express -{your choice view engine}


For example using express -e:

This sets the EJS engine as your view handler and removes jade. EJS has the look and feel of HTML with the added ability to inject values via their template system.