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.1.4 to 0.2.0

generate-require-legacy.js

23

CHANGELOG.md

@@ -5,10 +5,25 @@ # Changelog

### [0.1.4](https://github.com/cfware/node-preload/compare/v0.1.3...v0.1.4) (2019-11-01)
## [0.2.0](https://github.com/cfware/node-preload/compare/v0.1.4...v0.2.0) (2019-12-16)
### ⚠ BREAKING CHANGES
* The API is completely rewritten, the export is now an
Array.
* Propagated variables are no longer supported. For this
functionality preload a local module which uses `process-on-spawn`
directly.
### Features
* Use process-on-spawn ([#6](https://github.com/cfware/node-preload/issues/6)) ([2decb3a](https://github.com/cfware/node-preload/commit/2decb3a32a00084d089d964de6440e9f7817d563))
## [0.1.4](https://github.com/cfware/node-preload/compare/v0.1.3...v0.1.4) (2019-11-01)
### Features
* Support running under yarn pnp ([#3](https://github.com/cfware/node-preload/issues/3)) ([15d949b](https://github.com/cfware/node-preload/commit/15d949b)), closes [istanbuljs/nyc#1204](https://github.com/istanbuljs/nyc/issues/1204)
### [0.1.3](https://github.com/cfware/node-preload/compare/v0.1.2...v0.1.3) (2019-10-07)
## [0.1.3](https://github.com/cfware/node-preload/compare/v0.1.2...v0.1.3) (2019-10-07)

@@ -20,3 +35,3 @@

### [0.1.2](https://github.com/cfware/node-preload/compare/v0.1.1...v0.1.2) (2019-09-24)
## [0.1.2](https://github.com/cfware/node-preload/compare/v0.1.1...v0.1.2) (2019-09-24)

@@ -28,3 +43,3 @@

### [0.1.1](https://github.com/cfware/node-preload/compare/v0.1.0...v0.1.1) (2019-09-23)
## [0.1.1](https://github.com/cfware/node-preload/compare/v0.1.0...v0.1.1) (2019-09-23)

@@ -31,0 +46,0 @@

31

package.json
{
"name": "node-preload",
"version": "0.1.4",
"version": "0.2.0",
"description": "Request that Node.js child processes preload modules",

@@ -8,3 +8,3 @@ "scripts": {

"pretest": "xo",
"test": "tap"
"test": "nyc tape test/*.js"
},

@@ -14,6 +14,3 @@ "engines": {

},
"main": "node-preload.js",
"files": [
"node-preload*.js"
],
"main": "index.js",
"author": "Corey Farrell",

@@ -29,8 +26,28 @@ "license": "MIT",

"homepage": "https://github.com/cfware/node-preload#readme",
"dependencies": {
"process-on-spawn": "^1.0.0"
},
"devDependencies": {
"esm": "^3.2.25",
"glob": "^7.1.6",
"nyc": "^15.0.0-beta.3",
"standard-version": "^7.0.0",
"tap": "^14.6.5",
"tape": "^4.11.0",
"xo": "^0.25.3"
},
"xo": {
"rules": {
"import/no-unassigned-import": [
2,
{
"allow": [
"hook-spawn.js"
]
}
]
},
"ignores": [
"fixtures/esm.js"
]
}
}

@@ -24,43 +24,18 @@ # node-preload

const nodePreload = require('node-preload');
const preloadList = require('node-preload');
// Request that all Node.js child processes preload @babel/register
nodePreload.preloadAppend(require.resolve('@babel/register'));
// Request that child processes be spawned with enviroment TEST1=value1
nodePreload.propagateEnv.TEST1 = 'value1';
preloadList.push(require.resolve('@babel/register'));
```
### preloadAppend(filename)
## Limitations
Append `filename` to the list of modules to be preloaded.
If `filename` is already in the list it will be moved to the end.
Worker threads are not directly supported by this module, results may vary.
### preloadInsert(filename)
## `node-preload` for enterprise
Insert `filename` to the list of modules to be preloaded.
If `filename` is already in the list it will be moved to the beginning.
Available as part of the Tidelift Subscription.
### preloadRemove(filename)
The maintainers of `node-preload` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-node-preload?utm_source=npm-node-preload&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
Remove `filename` from the list of modules to be preloaded.
### preloadGetList()
Retrieve an array listing the current filenames to be preloaded.
### propagateEnv
Similar to `process.env` but controls environmental variables to be propagated
to child processes.
## Running tests
Tests are provided by xo and ava.
```sh
npm install
npm test
```
[npm-image]: https://img.shields.io/npm/v/node-preload.svg

@@ -67,0 +42,0 @@ [npm-url]: https://npmjs.org/package/node-preload

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