npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

gulp-pug-3

v2.0.2

Published

Modern Gulp plugin for Pug 3.x template compilation - Fast HTML generation from Pug templates with source maps, filters, and full Pug API support. Actively maintained.

Downloads

610

Readme

gulp-pug-3

CI npm version npm downloads node version license

Modern Gulp plugin for Pug 3.x template compilation - Fast HTML generation from Pug templates with source maps, filters, and full Pug API support. Actively maintained.

Compiles your Pug templates into HTML or JavaScript easily and always uses the latest stable version of Pug.

Features

  • ✅ Supports the latest Pug version (3.x)
  • ✅ Compiles to HTML or JS
  • ✅ Custom locals and options
  • ✅ Works with Gulp 4.x
  • ✅ Modern Node.js support (18+)

Installation

npm install --save-dev gulp-pug-3

Usage

Basic Example

const { src, dest } = require('gulp');
const pug = require('gulp-pug-3');

function compilePug() {
  return src('src/**/*.pug')
    .pipe(
      pug({
        // Your options here
      })
    )
    .pipe(dest('dist'));
}

exports.default = compilePug;

With Options

const { src, dest } = require('gulp');
const pug = require('gulp-pug-3');

function compilePug() {
  return src('src/**/*.pug')
    .pipe(
      pug({
        locals: {
          siteName: 'My Website',
          lang: 'en',
        },
        pretty: true,
        basedir: __dirname + '/src',
      })
    )
    .pipe(dest('dist'));
}

exports.default = compilePug;

Compile to JavaScript

const { src, dest } = require('gulp');
const pug = require('gulp-pug-3');

function compilePugToJs() {
  return src('src/**/*.pug')
    .pipe(
      pug({
        client: true,
        extension: '.js',
      })
    )
    .pipe(dest('dist'));
}

exports.default = compilePugToJs;

API

In addition to Pug's standard options, the following options are available:

client

Type: Boolean Default: false

Compile to JavaScript template function instead of HTML.

extension

Type: String Default: .html (or .js if client: true)

Output file extension.

locals

Type: Object Default: {}

Data to pass to Pug templates. Can also be set via file.data (e.g., with gulp-data).

Other Pug Options

All standard Pug options are supported:

  • filename
  • basedir
  • doctype
  • pretty
  • filters
  • self
  • debug
  • compileDebug
  • globals
  • cache
  • inlineRuntimeFunctions
  • name

See Pug documentation for details.

Requirements

  • Node.js >= 18.0.0
  • Gulp >= 4.0.0

Changelog

v2.0.2 (2025)

  • 🚀 Updated config files to latest standards
  • 🚀 Improved development workflow
  • 🚀 Better code quality tools
  • 🚀 Updated SEO-friendly package description

v2.0.1 (2025)

  • Dependency updates

v2.0.0 (2025)

  • 🚀 Updated to Pug 3.0.3
  • 🚀 Modernized dependencies
  • 🚀 Added GitHub Actions CI
  • 🚀 Improved code quality with Prettier & ESLint
  • 🚀 Node.js 18+ support

v1.2.2 (2021)

  • Previous stable release

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Troubleshooting

When you encounter a problem, please open an issue. I would be glad to help you find a solution.

Author

Orçun Saltık

License

MIT © Orçun Saltık