Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 20, 2024 via pnpm

pug 3.0.2

A clean, whitespace-sensitive template language for writing HTML
Package summary
Share
0
issues
1
license
51
MIT
Package created
22 Aug 2013
Version published
28 Feb 2021
Maintainers
2
Total deps
51
Direct deps
8
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
51 Packages, Including:
@babel/helper-string-parser@7.24.1
@babel/helper-validator-identifier@7.22.20
@babel/parser@7.24.4
@babel/types@7.24.0
acorn@7.4.1
asap@2.0.6
assert-never@1.2.1
babel-walk@3.0.0-canary-5
call-bind@1.0.7
character-parser@2.2.0
constantinople@4.0.1
define-data-property@1.1.4
doctypes@1.1.0
es-define-property@1.0.0
es-errors@1.3.0
function-bind@1.1.2
get-intrinsic@1.2.4
gopd@1.0.1
has-property-descriptors@1.0.2
has-proto@1.0.3
has-symbols@1.0.3
has-tostringtag@1.0.2
hasown@2.0.2
is-core-module@2.13.1
is-expression@4.0.0
is-promise@2.2.2
is-regex@1.1.4
js-stringify@1.0.2
jstransformer@1.0.0
object-assign@4.1.1
path-parse@1.0.7
promise@7.3.1
pug-attrs@3.0.0
pug-code-gen@3.0.2
pug-error@2.0.0
pug-filters@4.0.0
pug-lexer@5.0.1
pug-linker@4.0.0
pug-load@3.0.0
pug-parser@6.0.0
pug-runtime@3.0.1
pug-strip-comments@2.0.0
pug-walk@2.0.0
pug@3.0.2
resolve@1.22.8
set-function-length@1.2.2
supports-preserve-symlinks-flag@1.0.0
to-fast-properties@2.0.0
token-stream@1.0.0
void-elements@3.1.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

8
All Dependencies CSV
β“˜ This is a list of pug 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
pug-code-gen3.0.27.9 kBMIT
prod
pug-filters4.0.03.59 kBMIT
prod
pug-lexer5.0.113.38 kBMIT
prod
pug-linker4.0.03.11 kBMIT
prod
pug-load3.0.03.27 kBMIT
prod
pug-parser6.0.07.75 kBMIT
prod
pug-runtime3.0.16.39 kBMIT
prod
pug-strip-comments2.0.02.39 kBMIT
prod

Visualizations

Frequently Asked Questions

What does pug do?

Pug is a high-performance template engine that's predominantly utilized for writing HTML. Implemented using JavaScript for Node.js and browsers, it adopts a clean, whitespace-sensitive syntax which allows you to write HTML in a terse and simple way. The engine has a strong focus on performance and offers powerful features to facilitate website development.

How do you use pug?

To utilize Pug, you need to first install it via npm by executing the command npm install pug. After installation, you can use Pug for writing HTML markup in a simplified manner. Consider the following basic example:

doctype html
html(lang="en")
  head
    title= pageTitle
    script(type='text/javascript').
      if (foo) bar(1 + 5)
  body
    h1 Pug - Node template engine 
    #container.col
      if youAreUsingPug
        p You are amazing
      else
        p Get on it!
      p.
        Pug is a terse and simple templating language with a
        strong focus on performance and powerful features.

This Pug code will be compiled to the following HTML:

<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Pug</title>
    <script type="text/javascript">
      if (foo) bar(1 + 5)
    </script>
  </head>
  <body>
    <h1>Pug - Node template engine</h1>
    <div id="container" class="col">
      <p>You are amazing</p>
      <p>Pug is a terse and simple templating language with a strong focus on performance and powerful features.</p>
    </div>
  </body>
</html>

To use the Pug API, you can invoke methods such as pug.compile, pug.render, and pug.renderFile that can take a string of Pug or a file name, along with options and locals:

var pug = require('pug');

// compile
var fn = pug.compile('string of pug', options);
var html = fn(locals);

// render
var html = pug.render('string of pug', merge(options, locals));

// renderFile
var html = pug.renderFile('filename.pug', merge(options, locals));

Where are the pug docs?

The complete documentation for Pug is available at https://pugjs.org/. This includes a reference to its API, tutorials, and additional resources that will help you get started with Pug and master its features and usage in your web development projects.