npm / npm/documentation

[FEATURE] Add more fields to the `package.json` documentation

Open
#18 6 comments 1 reaction 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

When creating JS libraries, the package.json documentation on docs.npmjs.com is one of the most helpful resources to me. However it is far from complete, there are many fields that aren't documented there, but they are often needed in order to make a working library. These are for example:

  • exports – which module should be used when using module requests like import "package/sub/path", src: [1], [2]
  • types and typesVersions – type declarations for TS, src: [3]
  • module – the main entry point for an ESM project, src: [4], [5], [6]
  • typewhether the main entrypoint is whether all .js files are a CommonJS or ES Module, src: [7]

While these options aren't directly used by the NPM CLI, I think it would be great to include them, since they are a de-facto standard shared by many different systems. Should I make a PR that adds them?

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 package.json documentation page and compare its existing coverage with the linked Node.js, webpack, and TypeScript references. Document the proposed exports, types, typesVersions, module, and type fields, with accurate descriptions and sources; done means these commonly used fields are covered clearly in the page.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js, typescript
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.