Node.js source code of require() function

Viewed 2249
2 Answers

To answer my own question, I think it's defined in loader.js. And you can see it's implemented for all modules. It seems to be mapped to global.require in node.js

This seems to be it (in node/lib/internal/modules/cjs/helpers.js).

Related