# Repository: pugjs/pug
# Stars: 21847
## README.md
# Pug
Full documentation is at [pugjs.org](https://pugjs.org/)
Pug is a high-performance template engine heavily influenced by [Haml](http://haml.info/)
and implemented with JavaScript for [Node.js](http://nodejs.org) and browsers. For bug reports,
feature requests and questions, [open an issue](https://github.com/pugjs/pug/issues/new).
For discussion join the [chat room](https://gitter.im/pugjs/pug).
You can test drive Pug online [here](https://pugjs.org/).
[Professionally supported pug is now available](https://tidelift.com/subscription/pkg/npm-pug?utm_source=npm-pug&utm_medium=referral&utm_campaign=readme)
[](https://github.com/pugjs/pug/actions?query=workflow%3ATest+branch%3Amaster)
[](https://rollingversions.com/pugjs/pug)
[](https://www.npmjs.com/package/pug)
[](https://gitter.im/pugjs/pug?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
## Packages
Package Name | Version
-------------|--------
pug | [](https://www.npmjs.com/package/pug)
pug-attrs | [](https://www.npmjs.com/package/pug-attrs)
pug-code-gen | [](https://www.npmjs.com/package/pug-code-gen)
pug-error | [](https://www.npmjs.com/package/pug-error)
pug-filters | [](https://www.npmjs.com/package/pug-filters)
pug-lexer | [](https://www.npmjs.com/package/pug-lexer)
pug-linker | [](https://www.npmjs.com/package/pug-linker)
pug-load | [](https://www.npmjs.com/package/pug-load)
pug-parser | [](https://www.npmjs.com/package/pug-parser)
pug-runtime | [](https://www.npmjs.com/package/pug-runtime)
pug-strip-comments | [](https://www.npmjs.com/package/pug-strip-comments)
pug-walk | [](https://www.npmjs.com/package/pug-walk)
## Rename from "Jade"
This project was formerly known as "Jade". However, it was revealed to us that "Jade" is a registered trademark; as a result, a rename was needed. After some discussion among the maintainers, **"Pug"** was chosen as the new name for this project. As of version 2, "pug" is the official package name.
If your package or app currently uses `jade`, don't worry: we have secured permissions to continue to occupy that package name, although all new versions will be released under `pug`.
Before the renaming, work had already begun on “Jade 2.0.0”. Therefore, the rename to Pug coincided with the major version bump. As a result, upgrading from Jade to Pug will be the same process as upgrading any other package with a major version bump.
The syntax of Pug has several differences, deprecations, and removals compared to its predecessor. These differences are documented in [#2305](https://github.com/pugjs/pug/issues/2305).
The website and documentation for Pug are still being updated. But if you are new to Pug, you should get started with the new syntax and install the Pug package from npm.
## Installation
### Package
To use Pug in your own JavaScript projects:
```bash
$ npm install pug
```
### Command Line
After installing the latest version of [Node.js](http://nodejs.org), install with:
```bash
$ npm install pug-cli -g
```
and run with
```bash
$ pug --help
```
## Syntax
Pug is a clean, whitespace sensitive syntax for writing HTML. Here is a simple example:
```pug
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.
```
Pug transforms the above to:
```html
You are amazing
Pug is a terse and simple templating language with a strong focus on performance and powerful features.