Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Shows where Node.js is looking to find a module
const Module = require('module')
Module._resolveLookupPaths = new Proxy(Module._resolveLookupPaths, {
apply(target, self, args) {
console.dir(args[1].paths)
return target.apply(self, args)
}
})
require('name-of-module')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment