Skip to content

Add an option to allow certain modules to search upwards #2

@sindresorhus

Description

@sindresorhus

I had the need to allow a specific module to require upwards, so I added a private option _allowedMethods in 64ac0d0. 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.

Context: atomiclabs/hyperdex@d54a47c

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions