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

gulp-tpl

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-tpl - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

36

index.js

@@ -83,3 +83,3 @@ 'use strict';

var errmsg = "";
try {

@@ -90,16 +90,32 @@ var data = {};

}
} catch (err) {
errmsg = "[gulp-tpl.html error: " + datafile + "] " + err;
}
if (fs.existsSync(hbsfile)) {
var tpl = fs.readFileSync(hbsfile, 'utf8');
file.contents = new Buffer(Handlebars.compile(tpl)(data));
} else if (fs.existsSync(ejsfile)) {
var tpl = fs.readFileSync(ejsfile, 'utf8');
file.contents = new Buffer(ejs.render(tpl, data));
if (errmsg==="") {
var tplname = name;
try {
if (fs.existsSync(hbsfile)) {
tplname += ".hbs";
var tpl = fs.readFileSync(hbsfile, 'utf8');
file.contents = new Buffer(Handlebars.compile(tpl)(data));
} else if (fs.existsSync(ejsfile)) {
tplname += ".ejs";
var tpl = fs.readFileSync(ejsfile, 'utf8');
file.contents = new Buffer(ejs.render(tpl, data));
}
} catch (err) {
errmsg = "[gulp-tpl.html error: " + dirname + tplname + "] " + err;
}
}
file.path = htmlfile;
} catch (err) {
this.emit('error', new gutil.PluginError('gulp-tpl.html', err));
if (errmsg!="") {
if (options.ignoreErr) {
gutil.log(errmsg);
} else {
this.emit('error', new gutil.PluginError('gulp-tpl.html', errmsg));
}
}
file.path = htmlfile;
this.push(file);

@@ -106,0 +122,0 @@ cb();

{
"name": "gulp-tpl",
"version": "0.1.0",
"version": "0.1.1",
"description": "(handlebars/ejs) + yaml -> html",

@@ -5,0 +5,0 @@ "author": "changkong <changkong012@gmail.com>",

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