@yarn-tool/resolve-package

resolve package root and package.json paths , work on node 17 too

Browse on unpkg