Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add --dry-run to npm install #41

Merged
merged 1 commit into from
Aug 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion doc/cli/npm-pack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ npm-pack(1) -- Create a tarball from a package

## SYNOPSIS

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

## DESCRIPTION

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

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

The `--dry-run` argument will do everything that pack usually does without
actually packing anything. Reports on what would have gone into the tarball.

## SEE ALSO

* npm-cache(1)
Expand Down
11 changes: 7 additions & 4 deletions doc/cli/npm-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ npm-publish(1) -- Publish a package

## SYNOPSIS

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

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

* `[--dry-run]`
Does everything publish would do except actually publishing to the registry.
Reports the details of what would have been published.

Fails if the package name and version combination already exists in
the specified registry.

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

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

## SEE ALSO

Expand Down
2 changes: 1 addition & 1 deletion lib/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const tar = require('tar')
const packlist = require('npm-packlist')
const ssri = require('ssri')

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

// if it can be installed, it can be packed.
pack.completion = install.completion
Expand Down
2 changes: 1 addition & 1 deletion lib/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const readUserInfo = require('./utils/read-user-info.js')
const semver = require('semver')
const statAsync = BB.promisify(require('graceful-fs').stat)

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

Expand Down