robust-require-resolve-pmb

0.1.4 • Public • Published

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

/robust-require-resolve-pmb/

    Package Sidebar

    Install

    npm i robust-require-resolve-pmb

    Weekly Downloads

    1

    Version

    0.1.4

    License

    ISC

    Unpacked Size

    6.87 kB

    Total Files

    6

    Last publish

    Collaborators

    • mk-pmb