npm / npm/cli

(feature request): add shortcut for --prefix

Open
#6,721 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
10.1k
Forks
4.7k
Avg merge
2d 2h
Merged PRs (30d)
19

Description

The problem

Currently, the --prefix option is used to specify a directory that you want to execute npm command for. Typing --prefix each time is a lot of work.

Solution

I propose a flag -p for the npm as a shortcut to quickly specify the --prefix option when running various commands.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the npm CLI handling for the existing --prefix option and the tests covering command-line option aliases. Check how the option is parsed across the npm commands mentioned in the issue. Done means -p accepts the same directory value and produces the same behavior as --prefix, with matching test coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.