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

node-preload

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

node-preload - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

7

CHANGELOG.md

@@ -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 @@

31

generate-require.js
'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
};

2

package.json
{
"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": {

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