Node.js Internals: How do I know where `process.binding ('eval')` is defined?

  • How do I find out where a JavaScript object is defined in the C ++ source code of node.js that I can access through process.binding('eval')? - I already found out what it is /src/node_script.ccin this special case, but: How can I find out where I can find this module only when I just look at the /src/directory overview ? I do not want to browse all the files in /src/to find the module.
  • Where can I find detailed information about the internal elements of process.binding()s?

Thank.

+5
source share
1 answer

Today I was looking for the same thing. I cannot guarantee that this will not happen, but this is what I discovered.

src/node_extensions.h , :

ITEM(node_module_name)

module_name - ()

, , ,

NODE_MODULE(node_module_name, 

, , evals process.bindings:

$ grep "NODE_MODULE(node_evals" src/*.cc
src/node_script.cc:NODE_MODULE(node_evals, node::InitEvals)
+2

All Articles