robust-require-resolve-pmb
v0.1.4
Published
My attempt to make a less annoying require.resolve for Node.js v12+.
Downloads
6
Readme
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
andpkg-name
'spackage.json
defines custom exports that don't include an export namedpackage.json
.
Known issues
- Needs more/better tests and docs.
Similar projects
resolve-package-path
: Also reliably finds apackage.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