node-preload
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -5,2 +5,9 @@ # Changelog | ||
### [0.2.1](https://github.com/cfware/node-preload/compare/v0.2.0...v0.2.1) (2019-12-22) | ||
### Bug Fixes | ||
* Support jumping between node.js versions ([#7](https://github.com/cfware/node-preload/issues/7)) ([68950a0](https://github.com/cfware/node-preload/commit/68950a07ab153cda5e0b5fec1407973169443bbb)), closes [istanbuljs/nyc#1246](https://github.com/istanbuljs/nyc/issues/1246) | ||
## [0.2.0](https://github.com/cfware/node-preload/compare/v0.1.4...v0.2.0) (2019-12-16) | ||
@@ -7,0 +14,0 @@ |
'use strict'; | ||
/* istanbul ignore next: version specific branching */ | ||
const requireType = Number(process.versions.node.split('.')[0]) < 12 ? 'legacy' : 'modern'; | ||
const path = require('path'); | ||
module.exports = require(`./generate-require-${requireType}.js`); | ||
const needsPathRegExp = /[\\ "]/; | ||
const needsPathEnv = dir => needsPathRegExp.test(dir); | ||
function generateRequire(filename) { | ||
if (needsPathEnv(filename)) { | ||
return `--require ${path.basename(filename)}`; | ||
} | ||
return `--require ${filename}`; | ||
} | ||
function processNodePath(value) { | ||
const dir = path.dirname(require.resolve('./preload-path/node-preload.js')); | ||
const existing = value === '' ? [] : value.split(path.delimiter); | ||
if (existing.includes(dir)) { | ||
return value; | ||
} | ||
return existing.concat(dir).join(path.delimiter); | ||
} | ||
module.exports = { | ||
generateRequire, | ||
processNodePath, | ||
needsPathEnv | ||
}; |
{ | ||
"name": "node-preload", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Request that Node.js child processes preload modules", | ||
@@ -5,0 +5,0 @@ "scripts": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
1
0
9223
12
98