mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
Allow third party hooks before main module load
Just put a file lib/_third_party_main.js into the build directory and take it from there.
This commit is contained in:
10
src/node.js
10
src/node.js
@@ -576,6 +576,16 @@
|
||||
process.argv[0] = path.join(cwd, process.argv[0]);
|
||||
}
|
||||
|
||||
// To allow people to extend Node in different ways, this hook allows
|
||||
// one to drop a file lib/_third_party_main.js into the build directory
|
||||
// which will be executed instead of Node's normal loading.
|
||||
if (process.binding('natives')['_third_party_main']) {
|
||||
process.nextTick(function () {
|
||||
Module._requireNative('_third_party_main');
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (process.argv[1]) {
|
||||
if (process.argv[1] == 'debug') {
|
||||
// Start the debugger agent
|
||||
|
||||
Reference in New Issue
Block a user