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

gulp-bem-project

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-bem-project - npm Package Compare versions

Comparing version 0.5.1 to 0.6.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 0.6.0
* **new**: `wrap-with-path` plugin now supports stream based vinyl files
## 0.5.1

@@ -2,0 +6,0 @@

4

package.json
{
"name": "gulp-bem-project",
"version": "0.5.1",
"version": "0.6.0",
"description": "Gulp plugins for modern BEM projects",

@@ -37,4 +37,4 @@ "bugs": {

"lint": "./node_modules/.bin/jshint -c .jshintrc index.js && ./node_modules/.bin/jscs -c .jscsrc index.js",
"test": "./node_modules/.bin/mocha -R spec --timeout 10000 --slow 5000 test/"
"test": "./node_modules/.bin/mocha -R spec --timeout 10000 --slow 5000 test/**/*.js test/*.js"
}
}

@@ -6,5 +6,30 @@ 'use strict';

const PLUGIN_NAME = 'gulp-bem-project => wrap-with-path';
function getPrefixString(filePath) {
return `/* begin: ${filePath} */\n`;
}
function getPostfixString(filePath) {
return `/* end: ${filePath} */\n`;
}
/**
* Wraps file content stream with prefix and postfix
*
* @param {Vinyl} file
* @return {Stream}
*/
function wrapFileContentsStream(file) {
const outputStream = through2();
outputStream.write(getPrefixString(file.path));
file.contents.pipe(outputStream);
process.nextTick(() => {
outputStream.write(getPostfixString(file.path));
});
return outputStream;
}
/**
* Wraps file contents with comments with file path

@@ -22,12 +47,11 @@ *

if (file.isStream()) {
callback(new gutil.PluginError(PLUGIN_NAME, 'Streaming is not supported'));
return;
file.contents = wrapFileContentsStream(file);
} else {
file.contents = Buffer.concat([
new Buffer(getPrefixString(file.path)),
file.contents,
new Buffer(getPostfixString(file.path))
]);
}
file.contents = Buffer.concat([
new Buffer(`/* begin: ${file.path} */\n`),
file.contents,
new Buffer(`/* end: ${file.path} */\n`)
]);
this.push(file);

@@ -34,0 +58,0 @@ callback();

Sorry, the diff of this file is not supported yet

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