Socket
Socket
Sign inDemoInstall

gulp-pug

Package Overview
Dependencies
88
Maintainers
4
Versions
31
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gulp-pug

Gulp plugin for compiling Pug templates


Version published
Weekly downloads
11K
decreased by-19.33%
Maintainers
4
Install size
5.20 MB
Created
Weekly downloads
 

Changelog

Source

5.0.0 (2021-06-09)

⚠ BREAKING CHANGES

  • Update dependencies (#221)
  • Convert to gulp scaffold, dropping node <10 support (#215)

Features

  • Add streaming support using vinyl-contents (#200) (642d1ea)
  • Add template filename to PluginError (#220) (cfaad8c)

Miscellaneous Chores

Readme

Source

gulp-pug

NPM version Downloads Build Status Coveralls Status

Gulp plugin for compiling Pug templates. Enabling you to compile your Pug templates into HTML or JS, with support for template locals, custom Pug filters, AMD wrapping, and others.

Usage

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

exports.views = () => {
  return src('./src/*.pug')
    .pipe(
      pug({
        // Your options in here.
      })
    )
    .pipe(dest('./dist'));
};

API

pug([opts])

  • opts (Object): Any options from Pug's API in addition to pug's own options.
  • opts.locals (Object): Locals to compile the Pug with. You can also provide locals through the data field of the file object, e.g. with gulp-data. They will be merged with opts.locals.
  • opts.data (Object): Same as opts.locals.
  • opts.client (Boolean): Compile Pug to JavaScript code.
  • opts.pug: A custom instance of Pug for gulp-pug to use.
  • opts.verbose: display name of file from stream that is being compiled.

To change opts.filename use gulp-rename before gulp-pug.

Returns a stream that compiles Vinyl files as Pug.

Also See

License

MIT

Keywords

FAQs

Last updated on 09 Jun 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc