0.1.3 • Published 3 years ago

robust-require-resolve-pmb v0.1.3

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

robust-require-resolve-pmb

My attempt to make a less annoying require.resolve for Node.js v12+.

API

This module exports one function:

makeResolver(rqr)

Returns the resolve function described below, based on rqr which should be the calling module's require function.

resolve(id)

Find the absolute path of module id.

  • Even if it's pkg-name/package.json and pkg-name's package.json defines custom exports that don't include an export named package.json.

Known issues

  • Needs more/better tests and docs.

Similar projects

  • resolve-package-path: Also reliably finds a package.json even with custom exports, but v3.1.0 seems to prefer the global version over the project-local version of same-named dependencies. (This might be intended behavior, see their docs.)

 

License

ISC