Convert Pug to HTML
Aug 12, 2021
The Pug npm module has a render()
function that converts Pug code into HTML as shown below.
const pug = require('pug');
const output = pug.render('h1 Hello, World!');
output; // '<h1>Hello, World!</h1>
Here is a simple Pug to HTML converter that works in your browser:
↓
Did you find this tutorial useful? Say thanks by starring our repo on GitHub!
More Node Tutorials
- Getting Started with Oso Authorization in Node.js
- Check if a File Exists in Node.js
- How To Fix "__dirname is not defined" Error in Node.js
- Working with UUID in Node
- Using bcrypt-js to Hash Passwords in JavaScript
- Working with the Node.js assert Library
- Modify Authorized redirect_uris For Google OAuth