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

grunt-nunjuckr

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt-nunjuckr - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

test/globals/data/data.json

15

Gruntfile.js

@@ -115,2 +115,17 @@ module.exports = function (grunt) {

]
},
testGlobal: {
options : {
data : grunt.file.readJSON('test/globals/data/data.json'),
globals: {
globalTitle: 'This is a global title'
}
},
files : [
{
src : 'test/globals/src/index.njs',
dest : 'test/globals/dest/index.html'
}
]
}

@@ -117,0 +132,0 @@ }

2

package.json
{
"name": "grunt-nunjuckr",
"version": "1.3.0",
"version": "1.4.0",
"description": "A grunt task rendering nunjucks templates to static html files.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -45,2 +45,37 @@ # grunt-nunjuckr

### Globals
Type: `Object` or `Array`
Default: `undefined`
Gives you the ability to specify globals within your config. There are two ways to do that: By
using an object or by using an array.
This example uses an object:
```javascript
{
options: {
globals: {
globalName: 'Global Value'
}
}
}
```
This example uses an array:
```javascript
{
options: {
globals: [
{
name: 'globalName',
value: 'Global Value'
}
]
}
}
```
### ContentDimensions

@@ -47,0 +82,0 @@

@@ -26,2 +26,15 @@ /**

if (typeof options.globals === 'object') {
for (var globalName in options.globals) {
var globalVal = options.globals[globalName];
njEnv.addGlobal(globalName, globalVal);
}
} else if (typeof options.globals === 'array') {
options.globals.forEach(function(globalObj) {
if (typeof globalObj === 'object') {
njEnv.addGlobal(globalObj.name, globalObj.value);
}
});
}
var renderFiles = ( function( contentDimensions ) {

@@ -28,0 +41,0 @@ var fileIterator = function(callback) {

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