New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.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.1.1 to 1.2.0

4

index.js

@@ -27,3 +27,5 @@ 'use strict';

try {
file.contents = new Buffer(ejs.render(file.contents.toString(), options));
file.contents = new Buffer(
ejs.render(file.contents.toString(), file.data || options)
);
file.path = gutil.replaceExtension(file.path, settings.ext);

@@ -30,0 +32,0 @@ } catch (err) {

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

@@ -5,0 +5,0 @@ "keywords": [

@@ -51,2 +51,4 @@ # gulp-ejs [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url]

**Note:** As of `v1.2.0`, `file.data` is supported as a way of passing data into ejs. See [this](https://github.com/colynb/gulp-data#note-to-gulp-plugin-authors).
#### settings

@@ -53,0 +55,0 @@ Type: `hash`

@@ -220,3 +220,35 @@ /*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();
});
});
});
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