Skip to content

Commit 13f460c

Browse files
GnorTechrogerwang
authored andcommitted
support node-main
1 parent 5653309 commit 13f460c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/node.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
global.process.mainModule = module;
6060
module._compile('global.module = module;\n' +
6161
'global.require = global.__nw_require = require;\n', 'nw-emulate-node');
62+
if (process.argv[1]) {
63+
var path = NativeModule.require('path');
64+
process.argv[1] = path.resolve(process.argv[1]);
65+
startup.preloadModules();
66+
Module.runMain();
67+
}
6268
return;
6369
}
6470
// There are various modes that Node can run in. The most common two

0 commit comments

Comments
 (0)