New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-jsmodule

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-jsmodule - npm Package Compare versions

Comparing version 0.0.9 to 1.0.0

.idea/encodings.xml

50

index.js

@@ -9,4 +9,7 @@ var through = require('through'),

colors = require('colors'),
strftime = require('strftime');
strftime = require('strftime'),
md5 = require('md5');
var compiledFiles = {};
/**

@@ -132,2 +135,3 @@ * Log an error

var jsmoduleconcat = function (fileName, specialConfig) {
if (!fileName) throw new PluginError('jsmodule', 'Missing fileName option for jsmodule');

@@ -181,24 +185,36 @@

function endStream() {
var joinedPath = path.join(firstFileBase, fileName),
pathmd5 = md5(joinedPath);
if (specialConfig && specialConfig.replace && specialConfig.replace.length > 0) {
for (var i = 0; i < specialConfig.replace.length; i++) {
var fl = fs.readFileSync(specialConfig.replace[i], 'utf8');
jsm.integrateReplacementFromString(fl, specialConfig.replace[i]);
if (compiledFiles[pathmd5]) {
process.nextTick(function() {
var joinedFile = compiledFiles[pathmd5];
this.emit('data', joinedFile);
this.emit('end');
logEvent("Reconciled " + jsm.fileList.length + " files for " + fileName + " (from cache).");
}.bind(this));
} else {
if (specialConfig && specialConfig.replace && specialConfig.replace.length > 0) {
for (var i = 0; i < specialConfig.replace.length; i++) {
var fl = fs.readFileSync(specialConfig.replace[i], 'utf8');
jsm.integrateReplacementFromString(fl, specialConfig.replace[i]);
}
}
}
var joinedContents = jsm.getCompiledContents(config);
var joinedPath = path.join(firstFileBase, fileName);
var joinedContents = jsm.getCompiledContents(config);
var joinedFile = new File({
cwd: firstFileCwd,
base: firstFileBase,
path: joinedPath,
contents: new Buffer(joinedContents)
});
this.emit('data', joinedFile);
this.emit('end');
var joinedFile = new File({
cwd: firstFileCwd,
base: firstFileBase,
path: joinedPath,
contents: new Buffer(joinedContents)
});
logEvent("Reconciled " + jsm.fileList.length + " files for " + fileName + " (" + formatKB(joinedContents.length) + ").");
compiledFiles[pathmd5] = joinedFile;
this.emit('data', joinedFile);
this.emit('end');
logEvent("Reconciled " + jsm.fileList.length + " files for " + fileName + " (" + formatKB(joinedContents.length) + ").");
}
}

@@ -205,0 +221,0 @@

@@ -192,3 +192,2 @@ /**

JSModuleCompiler.prototype.integrateReplacementFromString = function (filestr, path) {
// Grab the header

@@ -278,3 +277,3 @@ var headerPos = this._regexIndexOf(filestr, /\([\w]*function[^\(]*\([a-zA-Z0-9\., _]*\)[^{]*{/g, 0);

this._applyRequires(requiredfiles[r]);
} catch(e) {
} catch (e) {
this._signalError("Possible recursive error: " + flc.path);

@@ -335,3 +334,3 @@ }

JSModuleCompiler.prototype.getCompiledContents = function (config) {
console.log(config);
this._reconcile();

@@ -338,0 +337,0 @@

{
"name": "gulp-jsmodule",
"version": "0.0.9",
"version": "1.0.0",
"description": "Gulp plugin for reconciling AMD dependency trees in JavaScript projects.",

@@ -27,4 +27,5 @@ "main": "index.js",

"strftime": "^0.9.2",
"through": "^2.3.7"
"through": "^2.3.7",
"md5": "^2.2.1"
}
}
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