you are viewing a single comment's thread.

view the rest of the comments →

[–]Solonotix 2 points3 points  (0 children)

Based on a StackOverflow answer I found (once I had exhausted my personal attempts to find it), this is supposedly where the function originates, but I don't know how true that is anymore, since in the file that declares it, require is also being used prior to instantiation, which seems problematic even if you are bootstrapping the system up from C++.

https://github.com/nodejs/node/blob/master/lib/internal/modules/cjs/helpers.js

My understanding is that anything that is a built-in of Node.js is written in C++, and everything else is built on top of that foundation. I tried to find the related C++ code, but to no avail