Skip to content

Commit de95640

Browse files
reconbotzkat
authored andcommitted
docs: add --dry-run to install and pack (#41)
PR-URL: #41 Credit: @reconbot Reviewed-By: @zkat
1 parent 08ecde2 commit de95640

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

doc/cli/npm-pack.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ npm-pack(1) -- Create a tarball from a package
33

44
## SYNOPSIS
55

6-
npm pack [[<@scope>/]<pkg>...]
6+
npm pack [[<@scope>/]<pkg>...] [--dry-run]
77

88
## DESCRIPTION
99

@@ -18,6 +18,9 @@ overwritten the second time.
1818

1919
If no arguments are supplied, then npm packs the current package folder.
2020

21+
The `--dry-run` argument will do everything that pack usually does without
22+
actually packing anything. Reports on what would have gone into the tarball.
23+
2124
## SEE ALSO
2225

2326
* npm-cache(1)

doc/cli/npm-publish.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ npm-publish(1) -- Publish a package
44

55
## SYNOPSIS
66

7-
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode]
7+
npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--otp otpcode] [--dry-run]
88

99
Publishes '.' if no argument supplied
1010
Sets tag 'latest' if no --tag specified
@@ -46,6 +46,10 @@ specifying a different default registry or using a `npm-scope(7)` in the name
4646
then you can provide a code from your authenticator with this. If you
4747
don't include this and you're running from a TTY then you'll be prompted.
4848

49+
* `[--dry-run]`
50+
Does everything publish would do except actually publishing to the registry.
51+
Reports the details of what would have been published.
52+
4953
Fails if the package name and version combination already exists in
5054
the specified registry.
5155

@@ -57,9 +61,8 @@ As of `npm@5`, both a sha1sum and an integrity field with a sha512sum of the
5761
tarball will be submitted to the registry during publication. Subsequent
5862
installs will use the strongest supported algorithm to verify downloads.
5963

60-
For a "dry run" that does everything except actually publishing to the
61-
registry, see `npm-pack(1)`, which figures out the files to be included and
62-
packs them into a tarball to be uploaded to the registry.
64+
Similar to `--dry-run` see `npm-pack(1)`, which figures out the files to be
65+
included and packs them into a tarball to be uploaded to the registry.
6366

6467
## SEE ALSO
6568

lib/pack.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const tar = require('tar')
3232
const packlist = require('npm-packlist')
3333
const ssri = require('ssri')
3434

35-
pack.usage = 'npm pack [[<@scope>/]<pkg>...]'
35+
pack.usage = 'npm pack [[<@scope>/]<pkg>...] [--dry-run]'
3636

3737
// if it can be installed, it can be packed.
3838
pack.completion = install.completion

lib/publish.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const readUserInfo = require('./utils/read-user-info.js')
2020
const semver = require('semver')
2121
const statAsync = BB.promisify(require('graceful-fs').stat)
2222

23-
publish.usage = 'npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>]' +
23+
publish.usage = 'npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--dry-run]' +
2424
"\n\nPublishes '.' if no argument supplied" +
2525
'\n\nSets tag `latest` if no --tag specified'
2626

0 commit comments

Comments
 (0)