Go to Github

Prevent `require` from searching upwards for required modules to Github

FundedView inAdd an option to allow certain modules to search upwards#2

sindresorhuscreated this issue 13 days ago

I had the need to allow a specific module to require upwards, so I added a private option _allowedMethods in I made it private because I'm not totally happy with it. It only works for top-level imports. So you can allow require('a') to be searched upwards by including a in the option, but if a imports a module name b, there's no way to allow b specifically, other than allowing any module from a.



Amount funded


Resolve this issue and earn $36.00

Fund this issue

Fund as

Payment method


Please sign in first to fund this issue

Sign in with

Pull requests



    URL of your pull request

    Submit your pull request

    Please sign in first to submit a pull request

    Sign in with