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

gulp-ejs

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-ejs - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

4

index.js

@@ -25,6 +25,8 @@ 'use strict';

options = file.data || options;
options.filename = file.path;
try {
file.contents = new Buffer(
ejs.render(file.contents.toString(), file.data || options)
ejs.render(file.contents.toString(), options)
);

@@ -31,0 +33,0 @@ file.path = gutil.replaceExtension(file.path, settings.ext);

{
"name": "gulp-ejs",
"version": "1.2.1",
"version": "1.2.2",
"description": "A plugin for Gulp that parses ejs template files",

@@ -27,8 +27,8 @@ "keywords": [

"ejs": "2.3.4",
"gulp-util": "3.0.6",
"gulp-util": "3.0.7",
"through2": "2.0.0"
},
"devDependencies": {
"mocha": "2.3.3",
"should": "7.1.0"
"mocha": "2.3.4",
"should": "8.0.0"
},

@@ -35,0 +35,0 @@ "engines": {

@@ -159,2 +159,34 @@ /*global describe, it*/

it('should support passing data with gulp-data', function (done) {
var srcFile = new gutil.File({ path: 'test/fixtures/ok.ejs',
cwd: 'test/',
base: 'test/fixtures',
contents: fs.readFileSync('test/fixtures/ok.ejs')
});
// simulate gulp-data plugin
srcFile.data = { title: 'gulp-ejs' };
var stream = ejs();
stream.on('error', function (err) {
should.exist(err);
done(err);
});
stream.on('data', function (newFile) {
should.exist(newFile);
should.exist(newFile.contents);
String(newFile.contents).should.equal(String(expectedFile.contents));
done();
});
stream.write(srcFile);
String(path.extname(srcFile.path)).should.equal('.html');
stream.end();
});
describe('with assets', function () {

@@ -221,35 +253,3 @@ it('should templating with javascripts', function (done) {

});
it('should support passing data with gulp-data', function (done) {
var srcFile = new gutil.File({ path: 'test/fixtures/ok.ejs',
cwd: 'test/',
base: 'test/fixtures',
contents: fs.readFileSync('test/fixtures/ok.ejs')
});
// simulate gulp-data plugin
srcFile.data = { title: 'gulp-ejs' };
var stream = ejs();
stream.on('error', function (err) {
should.exist(err);
done(err);
});
stream.on('data', function (newFile) {
should.exist(newFile);
should.exist(newFile.contents);
String(newFile.contents).should.equal(String(expectedFile.contents));
done();
});
stream.write(srcFile);
String(path.extname(srcFile.path)).should.equal('.html');
stream.end();
});
});
});
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