npmaargh 1.0.0 → 1.0.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 (3) hide show
  1. package/README.md +16 -0
  2. package/index.js +6 -4
  3. package/package.json +5 -1
package/README.md CHANGED
@@ -14,6 +14,15 @@ The report can be used to report blockers upstream or write more targeted
14
14
 
15
15
  ## Usage
16
16
 
17
+ You can either install and run:
18
+
19
+ ```shell
20
+ npm install --global npmaargh
21
+ npmaargh [flags...] [target]
22
+ ```
23
+
24
+ Or use `npx`:
25
+
17
26
  ```shell
18
27
  npx npmaargh [flags...] [target]
19
28
  ```
@@ -59,3 +68,10 @@ Let's unpack that report:
59
68
  tracker of `hello` is included to make it easy to report the blocker.
60
69
  - `world@0.1.0` is a transitive dependency of `hello@3.2.1`.
61
70
  - `# Need 1.1.1` indicates we need to bump it, because of a known vulnerability.
71
+
72
+ ## License
73
+
74
+ This software is available under the `AGPL-3.0-or-later` license, see [LICENSE]
75
+ for the full license text.
76
+
77
+ [LICENSE]: ./LICENSE
package/index.js CHANGED
@@ -69,7 +69,9 @@ async function npmList(subject) {
69
69
  if (!npmListCache.has(subject)) {
70
70
  async function fetch() {
71
71
  const { stdout } = await exec(`npm list ${subject} --json`, { cwd: wd });
72
- return JSON.parse(stdout);
72
+ const list = JSON.parse(stdout);
73
+ list.version ||= "1.0.0";
74
+ return list;
73
75
  }
74
76
 
75
77
  npmListCache.set(subject, fetch());
@@ -131,7 +133,7 @@ try {
131
133
  try {
132
134
  await exec("npm install --ignore-scripts", { cwd: wd });
133
135
  } catch (error) {
134
- console.error("Failed to (re)install dependencies:", error);
136
+ stdout.write("\rFailed to (re)install dependencies:", error);
135
137
  exit(1);
136
138
  }
137
139
  }
@@ -145,7 +147,7 @@ stdout.write("Obtaining audit report...");
145
147
  let npmAuditReport;
146
148
  try {
147
149
  await exec("npm audit --json", { cwd: wd });
148
- console.info("Nothing to audit.");
150
+ stdout.write("\rNothing to audit. ");
149
151
  exit(0);
150
152
  } catch (error) {
151
153
  npmAuditReport = JSON.parse(error.stdout);
@@ -153,7 +155,7 @@ try {
153
155
 
154
156
  const reportVersion = npmAuditReport.auditReportVersion;
155
157
  if (reportVersion !== 2) {
156
- console.error("Unknown audit report version:", reportVersion);
158
+ stdout.write("\rUnknown audit report version:", reportVersion);
157
159
  }
158
160
 
159
161
  stdout.write("\rObtained audit report. \n");
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "npmaargh",
3
3
  "description": "The npm audit assistant",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "repository": {
7
7
  "type": "git",
@@ -31,6 +31,10 @@
31
31
  ],
32
32
  "type": "module",
33
33
  "bin": "./index.js",
34
+ "engines": {
35
+ "node": ">=24",
36
+ "npm": ">=11"
37
+ },
34
38
  "dependencies": {
35
39
  "semver": "^7.3.8"
36
40
  }