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: make npm completion stay in sync with npm updates #7997

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from
Open
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
17 changes: 11 additions & 6 deletions docs/lib/content/commands/npm-completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,24 @@ description: Tab Completion for npm

### Description

Enables tab-completion in all npm commands.
Generates a shell script to enable tab-completion for all npm commands.

The synopsis above
loads the completions into your current shell. Adding it to
To load the completions into your current shell:

```bash
source <(npm completion)
```

Adding this to
your ~/.bashrc or ~/.zshrc will make the completions available
everywhere:

```bash
npm completion >> ~/.bashrc
npm completion >> ~/.zshrc
echo 'source <(npm completion)' >> ~/.bashrc
echo 'source <(npm completion)' >> ~/.zshrc
```

You may of course also pipe the output of `npm completion` to a file
You may of course instead add `source <(npm completion)` to a file
such as `/usr/local/etc/bash_completion.d/npm` or
`/etc/bash_completion.d/npm` if you have a system that will read
that file for you.
Expand Down