Socket
Socket
Sign inDemoInstall

karma-lodash-template-preprocessor

Package Overview
Dependencies
137
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-lodash-template-preprocessor

A Karma plugin. Compile Lo-Dash templates on the fly.


Version published
Weekly downloads
44
increased by15.79%
Maintainers
1
Install size
953 kB
Created
Weekly downloads
 

Readme

Source

karma-lodash-template-preprocessor

Karma preprocessor to compile Lo-Dash templates on the fly.

Installation

npm install karma-lodash-template-preprocessor --save-dev

Configuration

Following code shows the default configuration.

// karma.conf.js
module.exports = function( config ) {
  config.set({
    preprocessors: {
      "**/*.template.js": [ "lodash" ]
    },

    lodashPreprocessor: {
      // Template data. You can use function, which returns object
      data: {
        "this will be passed": "to _.template as second argument"
      },
      // Options passed to the _.template function as third argument:
      options: {
        interpolate: /regexp/,
        variable: "info"
        // Full list: http://lodash.com/docs#template
      },

      // Filename transform function ("file.template.js" > "file.js"):
      transformPath: function( path ) {
        return path.replace( /\.template\./i, "." );
      }
    }
  });
};

Keywords

FAQs

Last updated on 26 Sep 2014

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