Read: 11 EJS - cindyweiss/seattle-301d55 GitHub Wiki
Use EJS to Template Your Node Application (article used to make points for simple insertions of EJS)
When creating quick on-the-fly Node applications, an easy and fast way to template our application is sometimes necessary.For applications that need quick templating, there are many options that we can use. EJS is one alternative that does that job well and is very easy to set up.
common tags used when using EJS:
Tags
- <% 'Scriptlet' tag, for control-flow, no output
- <%_ ‘Whitespace Slurping’ Scriptlet tag, strips all whitespace before it
- <%= Outputs the value into the template (HTML escaped)
- <%- Outputs the unescaped value into the template
- <%# Comment tag, no execution, no output
- <%% Outputs a literal '<%'
- %> Plain ending tag
- -%> Trim-mode ('newline slurp') tag, trims following newline
- _%> ‘Whitespace Slurping’ ending tag, removes all whitespace after it