LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

npm-completion

generates shell completion scripts

TLDR

Print the completion script (same output for bash and zsh)
$ npm completion
copy
Load completion for the current bash session
$ source <(npm completion)
copy
Persist for bash
$ npm completion >> ~/.bashrc
copy
Persist for zsh (requires `compinit` to be loaded first)
$ npm completion >> ~/.zshrc
copy

SYNOPSIS

npm completion

DESCRIPTION

npm completion generates shell completion scripts. Enables tab completion for npm.The command outputs script to stdout. Append to shell rc file.

PARAMETERS

--help

Display help information.

CAVEATS

Only bash and zsh are supported. The script will do nothing under other shells (fish, PowerShell). When used in zsh, `bashcompinit` must be active, which zsh's own `compinit` handles automatically in any modern setup. Reload the shell (or `source` the rc file) after appending.

HISTORY

npm completion provides shell integration for command-line tab completion.

SEE ALSO

Copied to clipboard
Kai