nodejs/modules

Feature: Package encapsulation

GeoffreyBooth opened this issue · 0 comments

ESM should allow deep (non-main) inter-package imports via named entrypoints, in order to allow safe refactoring of published files that are both considered implementation details and are not exposed via the package.json main property.

This is already possible in CommonJS; the desire is to ensure that the same level of safeguarding and privacy can be achieved by future Node packages that want this and opt into this feature.
See also https://github.com/mikesamuel/tc39-module-keys

Use case 25.