@@ -10,7 +10,7 @@ const path = require('path');
10
10
11
11
/**
12
12
* Get the absolute path to the main entry point.
13
- * @param {string } main Entry point path
13
+ * @param {string } main - Entry point path
14
14
*/
15
15
function resolveMainPath ( main ) {
16
16
// Note extension resolution for the main entry point can be deprecated in a
@@ -31,7 +31,7 @@ function resolveMainPath(main) {
31
31
32
32
/**
33
33
* Determine whether the main entry point should be loaded through the ESM Loader.
34
- * @param {string } mainPath Absolute path to the main entry point
34
+ * @param {string } mainPath - Absolute path to the main entry point
35
35
*/
36
36
function shouldUseESMLoader ( mainPath ) {
37
37
/**
@@ -63,7 +63,7 @@ function shouldUseESMLoader(mainPath) {
63
63
64
64
/**
65
65
* Run the main entry point through the ESM Loader.
66
- * @param {string } mainPath Absolute path to the main entry point
66
+ * @param {string } mainPath - Absolute path for the main entry point
67
67
*/
68
68
function runMainESM ( mainPath ) {
69
69
const { loadESM } = require ( 'internal/process/esm_loader' ) ;
@@ -78,7 +78,7 @@ function runMainESM(mainPath) {
78
78
79
79
/**
80
80
* Handle process exit events around the main entry point promise.
81
- * @param {Promise } promise Main entry point promise
81
+ * @param {Promise } promise - Main entry point promise
82
82
*/
83
83
async function handleMainPromise ( promise ) {
84
84
const {
@@ -96,7 +96,8 @@ async function handleMainPromise(promise) {
96
96
* Parse the CLI main entry point string and run it.
97
97
* For backwards compatibility, we have to run a bunch of monkey-patchable code that belongs to the CJS loader (exposed
98
98
* by `require('module')`) even when the entry point is ESM.
99
- * @param {string } main CLI main entry point string
99
+ * Because of backwards compatibility, this function is exposed publicly via `import { runMain } from 'node:module'`.
100
+ * @param {string } main - Resolved absolute path for the main entry point, if found
100
101
*/
101
102
function executeUserEntryPoint ( main = process . argv [ 1 ] ) {
102
103
const resolvedMain = resolveMainPath ( main ) ;
0 commit comments