concept EJS in category express

This is an excerpt from Manning's book Express in Action: Writing, building, and testing Node.js applications.
We’ll add more to this file in a moment. The first block is the same as always: require what you need to. Then you say, “My views are in a folder called views.” After that, you say, “Use EJS.” EJS (documentation at https://github.com/tj/ejs) is a templating language that compiles to HTML. Make sure to install it with npm install ejs --save.
In this chapter we’ll talk about views, which give you a convenient way to dynamically generate content (usually HTML). You’ve seen a view engine before; EJS has helped you inject special variables into HTML. But although EJS provided a conceptual understanding of views, we never really explored everything that Express (and the other view engines) had to offer. You’ll learn the many ways to inject values into templates; see the features of EJS, Pug, and other Express-compatible view engines; and explore subtleties in the world of views. Let’s get started.
One of the simplest and most popular view engines out there is called EJS (Embedded JavaScript.) It can do templating for simple strings, HTML, plain text—you name it. It lightly integrates itself with whatever tool you use. It works in the browser and Node. If you’ve ever used ERB from the Ruby world, you’ll find that EJS is very similar. In any case, it’s pretty simple.
Two Versions of EJS
There are two versions of EJS maintained by two different groups of people. They’re similar but not identical. The one we’ll be using is by TJ Holowaychuck, the creator of Express. If you look for a package called ejs on npm, this is the one you’ll find. But if you visit http://embeddedjs.com/, you’ll find a very similar library with the same name. A lot of the functionality is the same, but it’s a different library, last updated in 2009. It doesn’t work in Node, and it has some debatably sexist sentences in its documentation. Avoid it!