npm / npm/documentation

[BUG] package.json vars documentation seems outdated

Open
#61 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

content
Dominant language
MDX
Stars
711
Forks
4.2k
Avg merge
4d 16h
Merged PRs (30d)
3

Description

What / Why

Apparently many package.json vars have been removed since v6 (reference). But docs are still pointing to them here:

You can access these variables in your code with process.env.npm_package_name and process.env.npm_package_version, and so on for other fields.

and here:

Objects are flattened following this format, so if you had {"scripts":{"install":"foo.js"}} in your package.json, then you'd see this in the script:
process.env.npm_package_scripts_install === "foo.js"

References

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 with the two linked npm scripts documentation sections and compare their package.json variable claims with npm/cli issue #2609. Revise the passages so they match supported behavior; done means the examples and wording no longer describe removed variables.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.