Socket
Socket
Sign inDemoInstall

gulp-pug

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-pug - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

25

out/index.js

@@ -20,13 +20,25 @@ 'use strict';

var _util = require('util');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function gulpPug() {
var opts = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
var base = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
base = typeof base !== 'undefined' ? base : {};
return _through2.default.obj(function stream(file, enc, callback) {
var error = null;
if (file.isBuffer()) {
var contents = _pug2.default.render(file.contents.toString(), opts);
file.contents = new Buffer(contents);
// Prepare new file.
var html = file.clone();
html.path = (0, _gulpUtil.replaceExtension)(html.path, '.html');
// Create options for pug.
var opts = (0, _util._extend)({
filename: file.path
}, base);
// Replace contents
if (html.isBuffer()) {
html.contents = new Buffer(_pug2.default.render(file.contents.toString(), opts));
} else {

@@ -36,7 +48,6 @@ error = new _gulpUtil.PluginError('gulp-pug', 'Unsupported file content');

file.path = (0, _gulpUtil.replaceExtension)(file.path, '.html');
callback(error, file);
// Continue
callback(error, html);
});
};
module.exports = exports['default'];
{
"name": "gulp-pug",
"version": "1.0.0",
"version": "1.1.0",
"description": "Gulp plugin for compiling Pug templates.",

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

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