ohdear-npm-audit 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/next.js +3 -2
  2. package/package.json +1 -1
package/dist/next.js CHANGED
@@ -47,9 +47,10 @@ function hasRecentLock(output) {
47
47
  * block the build — the subprocess runs in parallel with Next.js compilation.
48
48
  */
49
49
  function checkVulnerabilities(manifestPath) {
50
+ const safePath = JSON.stringify(manifestPath);
50
51
  const script = [
51
52
  `const fs = require("fs");`,
52
- `const manifest = JSON.parse(fs.readFileSync(process.argv[2], "utf-8"));`,
53
+ `const manifest = JSON.parse(fs.readFileSync(${safePath}, "utf-8"));`,
53
54
  `fetch("https://registry.npmjs.org/-/npm/v1/security/advisories/bulk", {`,
54
55
  ` method: "POST",`,
55
56
  ` headers: { "Content-Type": "application/json" },`,
@@ -73,7 +74,7 @@ function checkVulnerabilities(manifestPath) {
73
74
  `})`,
74
75
  `.catch(() => {});`,
75
76
  ].join("\n");
76
- const child = (0, node_child_process_1.spawn)("node", ["-e", script, manifestPath], {
77
+ const child = (0, node_child_process_1.spawn)("node", ["-e", script], {
77
78
  stdio: "inherit",
78
79
  detached: true,
79
80
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ohdear-npm-audit",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Oh Dear Application Health check for npm audit critical vulnerabilities",
5
5
  "main": "./dist/handler.js",
6
6
  "types": "./dist/handler.d.ts",