diff options
author | Marvin Hagemeister <hello@marvinh.dev> | 2023-05-11 00:13:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 00:13:45 +0200 |
commit | 5fd74bfa1c5ed514c3e19fdb2e8590fe251d3ee6 (patch) | |
tree | 837103ec9540d907391bc549e26854d15bcf36eb /ext/node/polyfills/01_require.js | |
parent | e72485fb1776d2ffebd90ff716374edfba42d603 (diff) |
feat(node): add `Module.runMain()` (#19080)
This PR adds the missing `Module.runMain()` function which is required
for tools like `ts-node`.
Fixes #19033
Diffstat (limited to 'ext/node/polyfills/01_require.js')
-rw-r--r-- | ext/node/polyfills/01_require.js | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ext/node/polyfills/01_require.js b/ext/node/polyfills/01_require.js index c73701ba8..a8a70c2fc 100644 --- a/ext/node/polyfills/01_require.js +++ b/ext/node/polyfills/01_require.js @@ -1108,6 +1108,11 @@ Module.syncBuiltinESMExports = function syncBuiltinESMExports() { throw new Error("not implemented"); }; +// Mostly used by tools like ts-node. +Module.runMain = function () { + Module._load(process.argv[1], null, true); +}; + Module.Module = Module; nativeModuleExports.module = Module; |