New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Properly document runAsNode utility process option #41255
Conversation
@@ -15,7 +15,7 @@ Fuses are the solution to this problem, at a high level they are "magic bits" in | |||
**Default:** Enabled | |||
**@electron/fuses:** `FuseV1Options.RunAsNode` | |||
|
|||
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. | |||
The runAsNode fuse toggles whether the `ELECTRON_RUN_AS_NODE` environment variable is respected or not. Please note that if this fuse is disabled then `process.fork` in the main process will not function as expected as it depends on this environment variable to function. Instead, we recommend that you use [Utility Processes](../api/utility-process.md), which work for many use cases where you need a standalone Node.js process (like a Sqlite server process or similar scenarios). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this recommendation also be added to docs/tutorial/security.md
for higher visibility? As in a new checklist item, vaguely speaking "AvoidELECTRON_RUN_AS_NODE
, use Utility Processes instead".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion, I'll add it there, too - probably in a separate PR!
Co-authored-by: Charles Kerr <charles@charleskerr.com>
No Release Notes |
I have automatically backported this PR to "29-x-y", please check out #41260 |
Description of Change
This PR properly documents (1) that utility processes do not receive an
stdout/stderr
pipe
by default and (2) that they are excellent alternatives toprocess.fork
when theRunAsNode
fuse is set tofalse
.Checklist
npm test
passesRelease Notes
Notes: no-notes