Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28ce509

Browse files
committed
CLI documentation update from CI
1 parent 692be4d commit 28ce509

File tree

6 files changed

+28
-9
lines changed

6 files changed

+28
-9
lines changed

content/cli/v8/commands/npm-audit.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ github_path: docs/content/commands/npm-audit.md
2121
<!-- see lib/commands/audit.js -->
2222

2323
```bash
24-
npm audit [fix]
24+
npm audit [fix|signatures]
2525
```
2626

2727
<!-- automatically generated, do not edit manually -->
@@ -51,6 +51,17 @@ vulnerability is found. It may be useful in CI environments to include the
5151
will cause the command to fail. This option does not filter the report
5252
output, it simply changes the command's failure threshold.
5353

54+
### Audit Signatures
55+
56+
This command can also audit the integrity values of the packages in your
57+
tree against any signatures present in the registry they were downloaded
58+
from. npm will attempt to download the keys from `/-/npm/v1/keys` on
59+
each the registry used to download any given package. It will then
60+
check the `dist.signatures` object in the package itself, and verify the
61+
`sig` present there using the `keyid` there, matching it with a key
62+
returned from the registry. The command for this is `npm audit
63+
signatures`
64+
5465
### Audit Endpoints
5566

5667
There are two audit endpoints that npm may use to fetch vulnerability

content/cli/v8/commands/npm.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ following help topics:
111111
done via [`npm install`](/cli/v8/commands/npm-install)
112112
* adduser:
113113
Create an account or log in. When you do this, npm will store
114-
credentials in the user config file config file.
114+
credentials in the user config file.
115115
* publish:
116116
Use the [`npm publish`](/cli/v8/commands/npm-publish) command to upload your
117117
code to the registry.

content/cli/v8/configuring-npm/package-json.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ IDs](https://spdx.org/licenses/). Ideally you should pick one that is
134134

135135
If your package is licensed under multiple common licenses, use an [SPDX
136136
license expression syntax version 2.0
137-
string](https://www.npmjs.com/package/spdx), like this:
137+
string](https://spdx.dev/specifications/), like this:
138138

139139
```json
140140
{

content/cli/v8/using-npm/scripts.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ There are some special life cycle scripts that happen only in certain
4747
situations. These scripts happen in addition to the `pre<event>`, `post<event>`, and
4848
`<event>` scripts.
4949

50-
* `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`
50+
* `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`, `dependencies`
5151

5252
**prepare** (since `[email protected]`)
5353
* Runs any time before the package is packed, i.e. during `npm publish`
@@ -79,6 +79,10 @@ situations. These scripts happen in addition to the `pre<event>`, `post<event>`,
7979
**postpack**
8080
* Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally)
8181

82+
**dependencies**
83+
* Runs AFTER any operations that modify the `node_modules` directory IF changes occurred.
84+
* Does NOT run in global mode
85+
8286
#### Prepare and Prepublish
8387

8488
**Deprecation Note: prepublish**
@@ -104,6 +108,10 @@ The advantage of doing these things at `prepublish` time is that they can be don
104108
* You don't need to rely on your users having `curl` or `wget` or
105109
other system tools on the target machines.
106110

111+
#### Dependencies
112+
113+
The `dependencies` script is run any time an `npm` command causes changes to the `node_modules` directory. It is run AFTER the changes have been applied and the `package.json` and `package-lock.json` files have been updated.
114+
107115
### Life Cycle Operation Order
108116

109117
#### [`npm cache add`](/cli/v8/commands/npm-cache)

content/cli/v8/using-npm/workspaces.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ structure of files and folders:
6565
```
6666
.
6767
+-- node_modules
68-
| `-- packages/a -> ../packages/a
68+
| `-- a -> ../packages/a
6969
+-- package-lock.json
7070
+-- package.json
7171
`-- packages
@@ -120,15 +120,15 @@ respect the provided `workspace` configuration.
120120

121121
Given the [specifities of how Node.js handles module resolution](https://nodejs.org/dist/latest-v14.x/docs/api/modules.html#modules_all_together) it's possible to consume any defined workspace
122122
by its declared `package.json` `name`. Continuing from the example defined
123-
above, let's also create a Node.js script that will require the `workspace-a`
123+
above, let's also create a Node.js script that will require the workspace `a`
124124
example module, e.g:
125125

126126
```
127-
// ./workspace-a/index.js
127+
// ./packages/a/index.js
128128
module.exports = 'a'
129129
130130
// ./lib/index.js
131-
const moduleA = require('workspace-a')
131+
const moduleA = require('a')
132132
console.log(moduleA) // -> a
133133
```
134134

0 commit comments

Comments
 (0)