With ESM modules, Node has introduced a 2nd use for package.json
.
So now the presence of a package.json
file does not necessarily indicate the root of a package. It could just contain {"type": "module"}
to indicate that a subdirectory's files are to be treated as ESM modules.
Could pkg-dir
check the contents of package.json
files found, and ignore any which don't indicate package root? Perhaps checking for a name
field would do the trick.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too