Skip to content

Commit 63d6a73

Browse files
authoredSep 17, 2024··
docs(package.json): add brief section on exports, link to Node.js docs (#7783)
The package.json docs make no reference to the `exports` property, which seems like a huge omission This PR copies a little text from the node.js docs and links to them - not sure if it's a good solution, but it's a start
1 parent 366c07e commit 63d6a73

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎docs/lib/content/configuring-npm/package-json.md

+4
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,10 @@ the `files` globs. Exceptions to this are:
337337

338338
These can not be included.
339339

340+
### exports
341+
342+
The "exports" provides a modern alternative to "main" allowing multiple entry points to be defined, conditional entry resolution support between environments, and preventing any other entry points besides those defined in "exports". This encapsulation allows module authors to clearly define the public interface for their package. For more details see the [node.js documentation on package entry points](https://nodejs.org/api/packages.html#package-entry-points)
343+
340344
### main
341345

342346
The main field is a module ID that is the primary entry point to your

0 commit comments

Comments
 (0)
Please sign in to comment.