Pug: About the Pug javascript.

By | 29/12/2019

I don’t like the Pug very much but for today I will write a simple intro tutorial.
The Pug is a template engine for Node and for the browser which can make you more productive and your code more readable.
It compiles to HTML and has a simplified syntax with more advanced features by building a simple Node/Express.
This is the official webpage for the Pug javascript.
You can convert the pug to HTML and back with this tool: pug HTML online tool
If you want to write some Pug source code, we’ll need to install Node Javascript.
Once Node and npm are installed on your system, you can install the pug-cli:

If you want to test it you can use Codepen online tool with these settings: select Settings -> HTML and choose Pug as your preprocessor.
You can write with Pug inline JavaScript code in your templates with these types of code: Unbuffered, Buffered, and Unescaped Buffered.
Unescaped buffered code can be dangerous. You must be sure to sanitize any user inputs to avoid cross-site scripting (XSS).
You can see some simple example on my Codepen account:

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.