Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt-processhtml

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-processhtml - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

5

package.json
{
"name": "grunt-processhtml",
"description": "Process html files at build time to modify them depending on the release environment",
"version": "0.3.2",
"version": "0.3.3",
"homepage": "https://github.com/dciccale/grunt-processhtml",

@@ -31,2 +31,5 @@ "author": {

},
"dependencies": {
"htmlprocessor": "~0.1.0"
},
"devDependencies": {

@@ -33,0 +36,0 @@ "grunt": "0.4.1",

21

README.md

@@ -214,21 +214,25 @@ # grunt-processhtml [![Build Status](https://travis-ci.org/dciccale/grunt-processhtml.png?branch=master)](https://travis-ci.org/dciccale/grunt-processhtml) [![NPM version](https://badge.fury.io/js/grunt-processhtml.png)](http://badge.fury.io/js/grunt-processhtml)

#### options.environment
Type: `Object`
Default value: `target`
The environemnt variable will be available to use in the comments, it defaults to the task target.
#### options.data
Type: `Object`
Default value: `{environment: target}`
Default value: `{}`
An object `data` that is passed to the `html` file used to compile all template blocks and the entire file if `process`
is true.
If a custom object is passed as `data`, this will be merged with the default to keep the `environment` key intact.
#### options.templateSettings
Type: `Object`
Default value: `null` (Will use default grunt template delimiters `<%` and `%>`)
Default value: `null` (Will use default lodash template delimiters `<%` and `%>`)
Define the `templateSettings` option with a custom `opener` and `closer` delimiters to customize the
template syntax delimiters.
Define the `templateSettings` option with lodash (templateSettings)[http://lodash.com/docs#templateSettings] options to customize the
template syntax.
```javascript
templateSettings: {
opener: '{{',
closer: '}}'
interpolate: /{{([\s\S]+?)}}/g // mustache
}

@@ -415,3 +419,3 @@ ```

options: {
process: true
process: true,
data: {

@@ -499,2 +503,3 @@ title: 'My app',

## Release History
- 0.3.3 Add [node-htmlprocessor](https://github.com/dciccale/node-htmlprocessor) as a dependency
- 0.3.2 Fix/feature #39

@@ -501,0 +506,0 @@ - 0.3.1 Fix #35

@@ -14,4 +14,3 @@ /*

var utils = require('../lib/utils');
var HTMLProcessor = require('../lib/htmlprocessor');
var HTMLProcessor = require('htmlprocessor');
var path = require('path');

@@ -29,24 +28,6 @@

customBlockTypes: [],
});
// Extend template data with the current target
grunt.util._.extend(options.data, {
environment: this.target
});
// Set custom delimiters
var templateSettings = options.templateSettings;
if (templateSettings && templateSettings.opener && templateSettings.closer) {
grunt.template.addDelimiters('lodash', templateSettings.opener, templateSettings.closer);
options.delimiters = 'lodash';
}
// Allow registering custom block types
var customBlockTypes = options.customBlockTypes;
if (customBlockTypes && customBlockTypes.length) {
options.customBlockTypes = customBlockTypes.map(function (processor) {
return path.resolve(processor);
});
}
var html = new HTMLProcessor(options);

@@ -66,3 +47,3 @@

if (options.process) {
content = utils.template(content, options);
content = html.template(content, html.data, options.templateSettings);
}

@@ -69,0 +50,0 @@

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc