What is pug.js?
Pug.js a HTML template engine for Node.js. You can write a simple pug code which the compiler will compile it to HTML code and later on browser will render it.
How does pug code differ from html code?
Pug code is a crisp piece of code which looks like a paragraph which helps in readability. Pug supports JavaScript, so using JavaScript expressions, we can format HTML code. HTML code is consists of tags and Pug also uses same tags. But pug doesn’t have closing tags.
Some thoughts…
Since pug comes as a npm package we can run using browser or on node.js using cli. One should take care of white space while writing pug code, because it can cost a big time.