Skip to content

process: add process.entrypoint - #64800

Open
avivkeller wants to merge 2 commits into
nodejs:mainfrom
avivkeller:process.entrypoint
Open

process: add process.entrypoint#64800
avivkeller wants to merge 2 commits into
nodejs:mainfrom
avivkeller:process.entrypoint

Conversation

@avivkeller

@avivkeller avivkeller commented Jul 28, 2026

Copy link
Copy Markdown
Member

Fixes: #51840

Adds a process.entrypoint non-configurable property to the process object during bootstrap. This property reflects the executable's main entrypoint (i.e. not --require or --import-ed files, the main file).

Additionally, this entrypoint is passed to workers, so it reflects the entrypoint of the process that created the worker, not the entrypoint of the worker itself.

Signed-off-by: avivkeller <me@aviv.sh>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Review requested:

  • @nodejs/loaders

@nodejs-github-bot nodejs-github-bot added esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem. labels Jul 28, 2026
@avivkeller

Copy link
Copy Markdown
Member Author

@nodejs/process

@mcollina

Copy link
Copy Markdown
Member

in worker threadsx this is set to the entrypoint of the worker?

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.12%. Comparing base (6a3d80f) to head (992b11a).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64800      +/-   ##
==========================================
- Coverage   90.16%   90.12%   -0.05%     
==========================================
  Files         744      744              
  Lines      242518   242571      +53     
  Branches    45705    45695      -10     
==========================================
- Hits       218670   218615      -55     
- Misses      15357    15443      +86     
- Partials     8491     8513      +22     
Files with missing lines Coverage Δ
lib/internal/main/worker_thread.js 94.46% <100.00%> (+0.11%) ⬆️
lib/internal/process/pre_execution.js 98.13% <100.00%> (+0.16%) ⬆️
lib/internal/worker.js 96.75% <100.00%> (+<0.01%) ⬆️

... and 38 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@avivkeller

avivkeller commented Jul 28, 2026

Copy link
Copy Markdown
Member Author

in worker threadsx this is set to the entrypoint of the worker?

This is set to the entrypoint of the process that created the worker, not the worker itself. So if /my/path/index.js creates /my/worker/index.js, entrypoint will a URL of /my/path/index.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

esm Issues and PRs related to the ECMAScript Modules implementation. needs-ci PRs that need a full CI run. process Issues and PRs related to the process subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a reliable way to find the entrypoint path or URL

3 participants