Skip to content

Commit cfdcf32

Browse files
committed
fix(docs): clean up npm unpublish docs
Mostly grammar fixes, also adds not about needing to be logged in, as per comment in #1880 PR-URL: #2474 Credit: @wraithgar Close: #2474 Reviewed-by: @darcyclarke
1 parent a3c1274 commit cfdcf32

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

docs/content/commands/npm-unpublish.md

+19-10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ description: Remove a package from the registry
66

77
### Synopsis
88

9+
To learn more about how the npm registry treats unpublish, see our <a
10+
href="https://www.npmjs.com/policies/unpublish" target="_blank"
11+
rel="noopener noreferrer"> unpublish policies</a>
12+
913
#### Unpublishing a single version of a package
1014

1115
```bash
@@ -20,22 +24,26 @@ npm unpublish [<@scope>/]<pkg> --force
2024

2125
### Warning
2226

23-
Consider using the `deprecate` command instead, if your intent is to encourage users to upgrade, or if you no longer want to maintain a package.
27+
Consider using the [`deprecate`](/commands/npm-deprecate) command instead,
28+
if your intent is to encourage users to upgrade, or if you no longer
29+
want to maintain a package.
2430

2531
### Description
2632

27-
This removes a package version from the registry, deleting its
28-
entry and removing the tarball.
29-
30-
If no version is specified, or if all versions are removed then
31-
the root package entry is removed from the registry entirely.
33+
This removes a package version from the registry, deleting its entry and
34+
removing the tarball.
3235

33-
Even if a package version is unpublished, that specific name and
34-
version combination can never be reused. In order to publish the
35-
package again, a new version number must be used. If you unpublish the entire package, you may not publish any new versions of that package until 24 hours have passed.
36+
The npm registry will return an error if you are not [logged
37+
in](/commands/npm-login).
3638

37-
To learn more about how unpublish is treated on the npm registry, see our <a href="https://www.npmjs.com/policies/unpublish" target="_blank" rel="noopener noreferrer"> unpublish policies</a>.
39+
If you do not specify a version or if you remove all of a package's
40+
versions then the registry will remove the root package entry entirely.
3841

42+
Even if you unpublish a package version, that specific name and version
43+
combination can never be reused. In order to publish the package again,
44+
you must use a new version number. If you unpublish the entire package,
45+
you may not publish any new versions of that package until 24 hours have
46+
passed.
3947

4048
### See Also
4149

@@ -44,3 +52,4 @@ To learn more about how unpublish is treated on the npm registry, see our <a hre
4452
* [npm registry](/using-npm/registry)
4553
* [npm adduser](/commands/npm-adduser)
4654
* [npm owner](/commands/npm-owner)
55+
* [npm login](/commands/npm-login)

lib/unpublish.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const completionFn = async (args) => {
3535
const access = await libaccess.lsPackages(username, opts)
3636
// do a bit of filtering at this point, so that we don't need
3737
// to fetch versions for more than one thing, but also don't
38-
// accidentally a whole project
38+
// accidentally unpublish a whole project
3939
let pkgs = Object.keys(access || {})
4040
if (!partialWord || !pkgs.length)
4141
return pkgs

0 commit comments

Comments
 (0)