New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

karma-pug-preprocessor

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-pug-preprocessor

A Karma plugin. Compile pug templates on the fly.

latest
Source
npmnpm
Version
1.0.0-beta.2
Version published
Weekly downloads
57
111.11%
Maintainers
1
Weekly downloads
 
Created
Source

karma-pug-preprocessor

Preprocessor to compile Pug templates on the fly.

Installation

The easiest way is to keep karma-pug-preprocessor as a devDependency in your package.json.

{
  "devDependencies": {
    "karma": "1.7.0",
    "karma-pug-preprocessor": "1.0.0-beta.2"
  }
}

You can simple do it by:

npm install karma-pug-preprocessor --save-dev

Configuration

Following code shows the default configuration...

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.pug': ['pug']
    }
  });
};

As with other preprocessors, One can further configure the options passed to Pug either by adding an extra property to your karma.conf.js:

pugPreprocessor: {
  options: {
    pretty: false
  }
}

Or by abstracting this into a custom preprocessor:

customPreprocessors: {
  myPug: {
    base: 'pug',
    options: {pretty: false}
  }
}

Chaining preprocessors

The pug preprocessor can be used in conjunction with others (eg. karma-ng-html2js-preprocessor). Simply include it in an array that specifies the chain of processors.

// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.pug': ['pug', 'ng-html2js']
    }
  });
};

For more information on Karma see the homepage.

Keywords

karma-plugin

FAQs

Package last updated on 14 Aug 2017

Did you know?

Socket

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