Latest Threat Research:SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains.Details
Socket
Book a DemoInstallSign in
Socket

gulp-hogan

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-hogan - npm Package Compare versions

Comparing version
1.1.0
to
1.2.0
+4
-3
index.js

@@ -7,9 +7,10 @@ 'use strict';

module.exports = function(data) {
module.exports = function(data, options, extension) {
data = data || {};
extension = extension || '.js';
return es.map(function (file, cb) {
file.contents = new Buffer( Hogan.compile(file.contents.toString()).render(data) );
file.path = gutil.replaceExtension(file.path, '.js');
file.contents = new Buffer( Hogan.compile(file.contents.toString(), options).render(data) );
file.path = gutil.replaceExtension(file.path, extension);
cb(null,file);
});
};
{
"name": "gulp-hogan",
"version": "1.1.0",
"version": "1.2.0",
"description": "gulp plugin to compile mustache templates",

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

+31
-5

@@ -6,2 +6,10 @@ 'use strict';

function fixture(stream, content)
{
stream.write(new gutil.File({
path: 'fixture.hogan',
contents: new Buffer(content)
}));
}
it('should compile hogan to js', function (cb) {

@@ -15,7 +23,25 @@ var stream = hogan({handle: 'gnumanth'});

});
fixture(stream, '{{handle}}');
});
stream.write(new gutil.File({
path: 'fixture.hogan',
contents: new Buffer('{{handle}}')
}));
});
it('should support custom delimiters', function (cb) {
var stream = hogan({handle: 'gnumanth'}, {delimiters: '<% %>'});
stream.on('data', function (file) {
assert.equal(file.relative, 'fixture.js');
assert.equal(file.contents.toString(), 'gnumanth');
cb();
});
fixture(stream, '<% handle %>');
});
it('should support custom extensions', function (cb) {
var stream = hogan({handle: 'gnumanth'}, null, '.html');
stream.on('data', function (file) {
assert.equal(file.relative, 'fixture.html');
assert.equal(file.contents.toString(), 'gnumanth');
cb();
});
fixture(stream, '{{handle}}');
});