Node.js · Middle · Question 64 of 75
What does the exports field in package.json do?
- 1Marks which functions are exported from
index.js - ✓Correct answer: Defines the package's public entry points and blocks imports of other internal files
- 3Lists the packages that this package depends on
Explanation
With exports, import "pkg/internal/x" fails unless that path is listed. It also supports conditions like import, require and types.