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!
Jade is a template engine for node. js and the default rendering engine for the Express web framework. It is a new, simplified language that compiles into HTML and is extremely useful for web developers. Jade is designed primarily for server-side templating in node.
Overview. View engines allow us to render web pages using template files. These templates are filled with actual data and served to the client. There are multiple view engines, the most popular of which is Embedded Javascript (EJS).
You don't need to install any extra modules to render an HTML file in Express. Just install express and you are good to go.
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}
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With