node-preload
Advanced tools
Comparing version 0.1.4 to 0.2.0
@@ -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 @@ |
{ | ||
"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 |
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
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
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 5 instances in 1 package
14
2
9311
1
6
110
48
+ Addedprocess-on-spawn@^1.0.0
+ Addedfromentries@1.3.2(transitive)
+ Addedprocess-on-spawn@1.1.0(transitive)