insert-module-globals
Advanced tools
Comparing version 6.4.3 to 6.5.0
#!/usr/bin/env node | ||
var insert = require('../'); | ||
var through = require('through'); | ||
var through = require('through2'); | ||
var concat = require('concat-stream'); | ||
@@ -12,3 +12,3 @@ var JSONStream = require('JSONStream'); | ||
.pipe(JSONStream.parse([ true ])) | ||
.pipe(through(write)) | ||
.pipe(through.obj(write)) | ||
.pipe(JSONStream.stringify()) | ||
@@ -18,3 +18,3 @@ .pipe(process.stdout) | ||
function write (row) { | ||
function write (row, enc, next) { | ||
var self = this; | ||
@@ -24,5 +24,6 @@ var s = insert(row.id, { basedir: basedir }); | ||
row.source = src.toString('utf8'); | ||
self.queue(row); | ||
self.push(row); | ||
next(); | ||
})); | ||
s.end(row.source); | ||
} |
18
index.js
var parseScope = require('lexical-scope'); | ||
var through = require('through'); | ||
var through = require('through2'); | ||
var merge = require('xtend'); | ||
var path = require('path'); | ||
var fs = require('fs'); | ||
var processPath = require.resolve('process/browser.js'); | ||
@@ -24,4 +23,4 @@ var combineSourceMap = require('combine-source-map'); | ||
__filename: function (file, basedir) { | ||
var file = '/' + path.relative(basedir, file); | ||
return JSON.stringify(file); | ||
var filename = '/' + path.relative(basedir, file); | ||
return JSON.stringify(filename); | ||
}, | ||
@@ -46,3 +45,2 @@ __dirname: function (file, basedir) { | ||
var resolved = {}; | ||
var chunks = []; | ||
@@ -52,3 +50,3 @@ | ||
function write (buf) { chunks.push(buf) } | ||
function write (chunk, enc, next) { chunks.push(chunk); next() } | ||
@@ -66,4 +64,4 @@ function end () { | ||
if (opts.always !== true && !quick.test(source)) { | ||
this.queue(source); | ||
this.queue(null); | ||
this.push(source); | ||
this.push(null); | ||
return; | ||
@@ -99,4 +97,4 @@ } | ||
this.queue(closeOver(globals, source, file, opts)); | ||
this.queue(null); | ||
this.push(closeOver(globals, source, file, opts)); | ||
this.push(null); | ||
} | ||
@@ -103,0 +101,0 @@ }; |
{ | ||
"name": "insert-module-globals", | ||
"version": "6.4.3", | ||
"version": "6.5.0", | ||
"description": "insert implicit module globals into a module-deps stream", | ||
@@ -15,8 +15,8 @@ "main": "index.js", | ||
"process": "~0.11.0", | ||
"through": "~2.3.4", | ||
"through2": "^1.0.0", | ||
"xtend": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"tap": "~0.4.0", | ||
"browser-pack": "^4.0.3", | ||
"tap": "^1.1.0", | ||
"browser-pack": "^5.0.0", | ||
"buffer": "^3.0.0", | ||
@@ -23,0 +23,0 @@ "module-deps": "^3.7.11" |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
17536
11
359
+ Addedthrough2@^1.0.0
+ Addedthrough2@1.1.1(transitive)
- Removedthrough@~2.3.4