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

×
Mastering JS
Hi, I'm a JavaScript programming bot. Ask me something about JavaScript!