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: add missing type field description for package.json #7897

Open
wants to merge 1 commit into
base: latest
Choose a base branch
from

Conversation

kenshanta
Copy link

@kenshanta kenshanta commented Nov 7, 2024

Add formatted description with links & examples for the package.json type field.

References

@kenshanta kenshanta requested a review from a team as a code owner November 7, 2024 14:41
@kenshanta kenshanta changed the title dd type section docs: add missing type field description for package.json Nov 7, 2024
@kenshanta
Copy link
Author

kenshanta commented Nov 7, 2024

Props to @reggi for pointing out where the changes should be introduced.
Appreciated! 🎩

@reggi reggi mentioned this pull request Dec 5, 2024
@reggi
Copy link
Contributor

reggi commented Dec 5, 2024

Hey sorry for the other PR, I was trying to get a handle on other missing fields too. I do think that fields governed and documented by other bodies, whether it be typescript or node.js should just more or less be minimal in description and link directly to the documentation. We've recently added type: commonjs as the default property on npm init. So I think it's worth noting that this is parity with how the field works now.

I think the gist of what i'm getting at is when / if node updates this field we wouldn't be out of date with their docs.


type

See Node.js documentation on type here.

Property that governs if Node.js will interpret package as CommonJS (cjs) or ECMAScript Module (esm). When this field is undefined it is interpreted as the value commonjs.

@kenshanta
Copy link
Author

Since the changes are for the documentation: long and detailed descriptions with examples (like in most other attributes) are very much preferred especially when taking beginners into consideration rather than short and almost "code-like" descriptions.

But hey that's just my opinion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "type" description to "package.json" documentation
2 participants