Skip to content

Commit

Permalink
support node-main
Browse files Browse the repository at this point in the history
  • Loading branch information
GnorTech authored and rogerwang committed Mar 18, 2016
1 parent c7f84f9 commit 6a88b1a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@
global.process.mainModule = module;
module._compile('global.module = module;\n' +
'global.require = global.__nw_require = require;\n', 'nw-emulate-node');
if (process.argv[1]) {
var path = NativeModule.require('path');
process.argv[1] = path.resolve(process.argv[1]);
startup.preloadModules();
Module.runMain();
}
return;
}
// There are various modes that Node can run in. The most common two
Expand Down

0 comments on commit 6a88b1a

Please sign in to comment.