From b3d78d89f81f92a2b1467bec72107f8632e4eac9 Mon Sep 17 00:00:00 2001 From: avivkeller Date: Mon, 27 Jul 2026 23:36:56 -0700 Subject: [PATCH 1/2] process: add `process.entrypoint` Signed-off-by: avivkeller --- doc/api/process.md | 11 ++ lib/internal/main/worker_thread.js | 7 +- lib/internal/modules/esm/hooks.js | 1 + lib/internal/process/pre_execution.js | 22 ++++ test/fixtures/entrypoint/check-commonjs.cjs | 5 + test/fixtures/entrypoint/check-module.mjs | 4 + test/fixtures/entrypoint/commonjs.cjs | 1 + test/fixtures/entrypoint/loader.mjs | 4 + test/fixtures/entrypoint/module.mjs | 1 + test/parallel/test-process-entrypoint.js | 105 ++++++++++++++++++++ 10 files changed, 160 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/entrypoint/check-commonjs.cjs create mode 100644 test/fixtures/entrypoint/check-module.mjs create mode 100644 test/fixtures/entrypoint/commonjs.cjs create mode 100644 test/fixtures/entrypoint/loader.mjs create mode 100644 test/fixtures/entrypoint/module.mjs create mode 100644 test/parallel/test-process-entrypoint.js diff --git a/doc/api/process.md b/doc/api/process.md index 0a7f85700ae85a..d006aea7fb3f6a 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1513,6 +1513,17 @@ emitMyWarning(); // Emits nothing ``` +## `process.entrypoint` + + + +* Type: {URL | undefined} + +The entrypoint that node was instantiated with, or {undefined} if node +was instantiated without one (e.g., in the REPL). + ## `process.env`