package.json exports

The package.json fields that declare which files a package makes importable (exports) and which private shortcuts start with # (imports).

In more detail

exports lets a package say that only lib/index.js may be imported, and under which subpaths such as my-lib/utils. imports defines internal aliases such as #db. NodeNext module resolution respects both, so TypeScript reports imports that Node.js would refuse.

Related terms

Taught in

References