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

grunt-contrib-jade

Package Overview
Dependencies
Maintainers
4
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-contrib-jade - npm Package Compare versions

Comparing version 0.3.1 to 0.4.0-rc7

.jshintrc

18

package.json
{
"name": "grunt-contrib-jade",
"description": "Compile Jade files to HTML.",
"version": "0.3.1",
"version": "0.4.0rc7",
"homepage": "https://github.com/gruntjs/grunt-contrib-jade",

@@ -23,5 +23,5 @@ "author": {

],
"main": "grunt.js",
"main": "Gruntfile.js",
"engines": {
"node": "*"
"node": ">= 0.8.0"
},

@@ -32,8 +32,10 @@ "scripts": {

"dependencies": {
"jade": "~0.27.2",
"grunt-lib-contrib": "~0.3.0"
"jade": "~0.27.2"
},
"devDependencies": {
"grunt": "~0.3.15",
"grunt-contrib-clean": "~0.3.0"
"grunt-contrib-jshint": "0.1.1rc6",
"grunt-contrib-nodeunit": "0.1.2rc6",
"grunt-contrib-clean": "0.4.0rc6",
"grunt-contrib-internal": "*",
"grunt": "0.4.0rc7"
},

@@ -43,2 +45,2 @@ "keywords": [

]
}
}

@@ -5,29 +5,39 @@ # grunt-contrib-jade [![Build Status](https://secure.travis-ci.org/gruntjs/grunt-contrib-jade.png?branch=master)](http://travis-ci.org/gruntjs/grunt-contrib-jade)

### Overview
Inside your `grunt.js` file add a section named `jade`. This section specifies files to compile and the options passed to [jade](https://github.com/visionmedia/jade#public-api).
## Getting Started
If you haven't used [grunt][] before, be sure to check out the [Getting Started][] guide, as it explains how to create a [gruntfile][Getting Started] as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:
#### Parameters
```shell
npm install grunt-contrib-jade --save-dev
```
##### files ```object```
[grunt]: http://gruntjs.com/
[Getting Started]: https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md
This defines what files this task will process and should contain key:value pairs.
The key (destination) should be an unique filepath (supports [grunt.template](https://github.com/gruntjs/grunt/blob/master/docs/api_template.md)) and the value (source) should be a filepath or an array of filepaths (supports [minimatch](https://github.com/isaacs/minimatch)).
## Jade task
_Run this task with the `grunt jade` command._
Note: When the value contains an array of multiple filepaths, the contents are concatenated in the order passed.
_This task is a [multi task][] so any targets, files and options should be specified according to the [multi task][] documentation._
[multi task]: https://github.com/gruntjs/grunt/wiki/Configuring-tasks
##### options ```object```
This controls how this task (and its helpers) operate and should contain key:value pairs, see options below.
_Version `0.4.x` of this plugin is compatible with Grunt `0.4.x`. Version `0.3.x` of this plugin is compatible with Grunt `0.3.x`._
#### Options
### Options
##### data ```object```
#### pretty
Type: `Boolean`
Default: false
Sets the data passed to ```jade``` during template compilation. Any data can be passed to the template (including ```grunt``` templates).
Output indented HTML.
#### Config Examples
#### data
Type: `Object`
``` javascript
Sets the data passed to `jade` during template compilation. Any data can be passed to the template (including `grunt` templates).
### Usage Examples
```js
jade: {

@@ -49,3 +59,3 @@ compile: {

``` javascript
```js
jade: {

@@ -77,3 +87,3 @@ debug: {

``` javascript
```js
jade: {

@@ -96,3 +106,3 @@ debug: {

``` javascript
```js
jade: {

@@ -113,4 +123,15 @@ debug: {

--
*Task submitted by [Eric Woroshow](https://github.com/errcw).*
## Release History
* 2013-01-23   v0.4.0rc7   Updating grunt/gruntplugin dependencies to rc7. Changing in-development grunt/gruntplugin dependency versions from tilde version ranges to specific versions.
* 2013-01-08   v0.4.0rc5   Updating to work with grunt v0.4.0rc5. Switching to this.files api.
* 2012-10-11   v0.3.1   Rename grunt-contrib-lib dep to grunt-lib-contrib.
* 2012-09-23   v0.3.0   Options no longer accepted from global config key.
* 2012-09-09   v0.2.0   Refactored from grunt-contrib into individual repo.
---
Task submitted by [Eric Woroshow](http://ericw.ca/)
*This file was generated on Fri Jan 25 2013 15:29:28.*

@@ -9,12 +9,8 @@ /*

'use strict';
module.exports = function(grunt) {
'use strict';
// TODO: ditch this when grunt v0.4 is released
grunt.util = grunt.util || grunt.utils;
grunt.registerMultiTask('jade', 'Compile Jade templates into HTML.', function() {
var helpers = require('grunt-lib-contrib').init(grunt);
var options = helpers.options(this, {
var options = this.options({
data: {}

@@ -25,20 +21,12 @@ });

// TODO: ditch this when grunt v0.4 is released
this.files = this.files || helpers.normalizeMultiTaskFiles(this.data, this.target);
this.files.forEach(function(f) {
var output = f.src.map(function(file) {
return compileJade(file, options, options.data);
}).join(grunt.util.normalizelf(grunt.util.linefeed));
var srcFiles;
var taskOutput;
this.files.forEach(function(file) {
srcFiles = grunt.file.expandFiles(file.src);
taskOutput = [];
srcFiles.forEach(function(srcFile) {
taskOutput.push(compileJade(srcFile, options, options.data));
});
if (taskOutput.length > 0) {
grunt.file.write(file.dest, taskOutput.join('\n'));
grunt.log.writeln('File ' + file.dest.cyan + ' created.');
if (output.length < 1) {
grunt.log.warn('Destination not written because compiled files were empty.');
} else {
grunt.file.write(f.dest, output);
grunt.log.writeln('File ' + f.dest.cyan + ' created.');
}

@@ -61,2 +49,2 @@ });

};
};
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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