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:

More Node Tutorials