module: replace default paths in require.resolve() by cjihrig · Pull Request #17113 · nodejs/node (original) (raw)
This is lengthier +1, but hopefully carrying a bit more information. We've looked at 8.9's require.resolve, as the docs seemed to fit our need for it (we currently use require-relative
for it). We tried it and it didn't work, we spend a good deal of time making minimal test cases, looking at the PR that introduced the feature and pondering why it doesn't work like intended (and how come nobody has complained, either in the PR or after!). We settled on keeping require-relative
, which basically does a similar thing as this PR proposes (creates a new Module
).
Point being, we're happy to see this PR! One of our devs has compiled node with it and confirms that it now works as we expected it to initially. 👍