@@ -9,7 +9,7 @@ const path = require('path');
9
9
10
10
/**
11
11
* Get the absolute path to the main entry point.
12
- * @param {string } main Entry point path
12
+ * @param {string } main - Entry point path
13
13
*/
14
14
function resolveMainPath ( main ) {
15
15
// Note extension resolution for the main entry point can be deprecated in a
@@ -30,7 +30,7 @@ function resolveMainPath(main) {
30
30
31
31
/**
32
32
* Determine whether the main entry point should be loaded through the ESM Loader.
33
- * @param {string } mainPath Absolute path to the main entry point
33
+ * @param {string } mainPath - Absolute path to the main entry point
34
34
*/
35
35
function shouldUseESMLoader ( mainPath ) {
36
36
/**
@@ -57,7 +57,7 @@ function shouldUseESMLoader(mainPath) {
57
57
58
58
/**
59
59
* Run the main entry point through the ESM Loader.
60
- * @param {string } mainPath Absolute path to the main entry point
60
+ * @param {string } mainPath - Absolute path for the main entry point
61
61
*/
62
62
function runMainESM ( mainPath ) {
63
63
const { loadESM } = require ( 'internal/process/esm_loader' ) ;
@@ -72,7 +72,7 @@ function runMainESM(mainPath) {
72
72
73
73
/**
74
74
* Handle process exit events around the main entry point promise.
75
- * @param {Promise } promise Main entry point promise
75
+ * @param {Promise } promise - Main entry point promise
76
76
*/
77
77
async function handleMainPromise ( promise ) {
78
78
const {
@@ -90,7 +90,8 @@ async function handleMainPromise(promise) {
90
90
* Parse the CLI main entry point string and run it.
91
91
* For backwards compatibility, we have to run a bunch of monkey-patchable code that belongs to the CJS loader (exposed
92
92
* by `require('module')`) even when the entry point is ESM.
93
- * @param {string } main CLI main entry point string
93
+ * Because of backwards compatibility, this function is exposed publicly via `import { runMain } from 'node:module'`.
94
+ * @param {string } main - Resolved absolute path for the main entry point, if found
94
95
*/
95
96
function executeUserEntryPoint ( main = process . argv [ 1 ] ) {
96
97
const resolvedMain = resolveMainPath ( main ) ;
0 commit comments