Skip to content

Commit 69b5a96

Browse files
authoredJun 22, 2022
docs: consolidate docs and help for package spec (#5048)
Many of our commands parse their args via [npm-package-arg](https://npm.im/npm-package-arg), which is a good standard way of parsing a "package" argument. However the docs surrounding these args are not very consistent. This can lead to confusion in commands such as `npm publish` where the behavior is slightly different than in the past due to this. This adds a new help command `npm help package-spec` that describes what this argument is, and can be, and also updates all the commands that interpret their args this with to refer to them as `<package-spec>`. It also adds a link to the new help page on their docs pages.
1 parent f2340f8 commit 69b5a96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+320
-268
lines changed
 

‎docs/content/commands/npm-cache.md

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,7 @@ description: Manipulates packages cache
1111
<!-- see lib/commands/cache.js -->
1212

1313
```bash
14-
npm cache add <tarball file>
15-
npm cache add <folder>
16-
npm cache add <tarball url>
17-
npm cache add <git url>
18-
npm cache add <name>@<version>
14+
npm cache add <package-spec>
1915
npm cache clean [<key>]
2016
npm cache ls [<name>@<version>]
2117
npm cache verify
@@ -101,6 +97,7 @@ cache`](/commands/npm-cache)
10197

10298
### See Also
10399

100+
* [package spec](/using-npm/package-spec)
104101
* [npm folders](/configuring-npm/folders)
105102
* [npm config](/commands/npm-config)
106103
* [npmrc](/configuring-npm/npmrc)

‎docs/content/commands/npm-ci.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ will *not* run any pre- or post-scripts.
133133
* Type: null or String
134134

135135
The shell to use for scripts run with the `npm exec`, `npm run` and `npm
136-
init <pkg>` commands.
136+
init <package-spec>` commands.
137137

138138
<!-- automatically generated, do not edit manually -->
139139
<!-- see lib/utils/config/definitions.js -->

0 commit comments

Comments
 (0)
Please sign in to comment.