diff --git a/lib/internal/modules/run_main.js b/lib/internal/modules/run_main.js index e5969bf7b75ea6..1c3576a8456699 100644 --- a/lib/internal/modules/run_main.js +++ b/lib/internal/modules/run_main.js @@ -30,7 +30,7 @@ function resolveMainPath(main) { /** * Determine whether the main entry point should be loaded through the ESM Loader. - * @param {string} mainPath Absolute path to the main entry point + * @param {string} mainPath - Absolute path to the main entry point */ function shouldUseESMLoader(mainPath) { /** @@ -57,7 +57,7 @@ function shouldUseESMLoader(mainPath) { /** * Run the main entry point through the ESM Loader. - * @param {string} mainPath Absolute path to the main entry point + * @param {string} mainPath - Absolute path for the main entry point */ function runMainESM(mainPath) { const { loadESM } = require('internal/process/esm_loader'); @@ -72,7 +72,7 @@ function runMainESM(mainPath) { /** * Handle process exit events around the main entry point promise. - * @param {Promise} promise Main entry point promise + * @param {Promise} promise - Main entry point promise */ async function handleMainPromise(promise) { const { @@ -90,7 +90,8 @@ async function handleMainPromise(promise) { * Parse the CLI main entry point string and run it. * For backwards compatibility, we have to run a bunch of monkey-patchable code that belongs to the CJS loader (exposed * by `require('module')`) even when the entry point is ESM. - * @param {string} main CLI main entry point string + * Because of backwards compatibility, this function is exposed publicly via `import { runMain } from 'node:module'`. + * @param {string} main - Resolved absolute path for the main entry point, if found */ function executeUserEntryPoint(main = process.argv[1]) { const resolvedMain = resolveMainPath(main);