Registry / devops / pug-cli

pug-cli

JSON →
library1.0.0-alpha6jsnpmunverified

Command-line interface for Pug (formerly Jade) template engine, version 1.0.0-alpha6. Allows compiling .pug files to HTML or client-side JavaScript. Supports watching, pretty-printing, custom output directories, and options via JSON/JS files. Primarily used for build tooling and static site generation. Maintained as part of the Pug project, though the CLI is in alpha with infrequent releases. Alternatives include gulp-pug or webpack loaders for integrated workflows.

devopsweb-framework
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CLI tool, not a module. Use npx pug or install globally.

pug file.pug

pug-cli is a CLI, not a module. Use require('pug') for API.

require('pug')

Import pug module, not pug-cli.

const pug = require('pug'); pug.compile('...')

Install pug-cli globally, create a .pug file, compile with JSON options from stdin, output HTML.

npm install -g pug-cli # Create a Pug template echo 'h1 Hello #{name}' > template.pug # Compile with variable echo '{"name": "World"}' | pug -O /dev/stdin template.pug cat template.html
pug --version
Debug
Known footguns
gotchaWhen using --client, the output is a JavaScript function, not HTML. You need to include the Pug runtime.
deprecatedThe --name-after-file option may be removed in future versions.
gotchaOutput directory is not created automatically if it doesn't exist; pug-cli will error.
gotchaThe -O option with JSON string must be a valid JSON object, not a JavaScript object literal with single quotes.
gotchaWhen using watch mode, only changes to files with .pug extension trigger re-render. Other file changes are ignored.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
12 hits · last 30 days
gptbot
4
ahrefsbot
4
bingbot
2
script
1
mj12bot
1
Resources