Skip to content

Commit 1831297

Browse files
committed
doc: name both flags a worker's execArgv needs
--vfs-load requires --experimental-vfs, so a worker that is handed its own execArgv needs both of them to load a script from the mount, not only --vfs-load. Passing --vfs-load alone happens to mount the source today, because the requirement is checked once for the process rather than for each thread's execArgv, but it leaves node:vfs unavailable to the worker's own code, and it is not what the option documents. Name both options in the worker paragraph, and say that --experimental-vfs is also what makes node:vfs available there. Signed-off-by: Philipp Dunkel <pip@pipobscure.com>
1 parent fc04b57 commit 1831297

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

‎doc/api/cli.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3827,11 +3827,12 @@ mounts it, whatever else that thread mounts, so a path into the mount means the
38273827
same thing in all of them.
38283828

38293829
A worker created with its own `execArgv` inherits none of the parent's options,
3830-
and so does not mount the source at all. Such a worker must be given the same
3831-
`--vfs-load` to run a script from the mount; without it, that thread has no
3832-
mount for the script to come from, and the worker fails to load it. A worker
3833-
whose script comes from anywhere else, such as the real file system, needs
3834-
nothing added.
3830+
and so does not mount the source at all. To run a script from the mount, such a
3831+
worker must be given the same options again, `--experimental-vfs` and
3832+
`--vfs-load`; without them, that thread has no mount for the script to come
3833+
from, and the worker fails to load it. `--experimental-vfs` is also what makes
3834+
[`node:vfs`][] available to the worker's own code. A worker whose script comes
3835+
from anywhere else, such as the real file system, needs nothing added.
38353836

38363837
`--vfs-load` is not permitted in [`NODE_OPTIONS`][]: which entry point runs is
38373838
the command line's decision, and the environment must not be able to redirect

‎doc/node.1‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1917,11 +1917,12 @@ The source is mounted at the same reserved mount point in every thread that
19171917
mounts it, whatever else that thread mounts, so a path into the mount means the
19181918
same thing in all of them.
19191919
A worker created with its own \fBexecArgv\fR inherits none of the parent's options,
1920-
and so does not mount the source at all. Such a worker must be given the same
1921-
\fB--vfs-load\fR to run a script from the mount; without it, that thread has no
1922-
mount for the script to come from, and the worker fails to load it. A worker
1923-
whose script comes from anywhere else, such as the real file system, needs
1924-
nothing added.
1920+
and so does not mount the source at all. To run a script from the mount, such a
1921+
worker must be given the same options again, \fB--experimental-vfs\fR and
1922+
\fB--vfs-load\fR; without them, that thread has no mount for the script to come
1923+
from, and the worker fails to load it. \fB--experimental-vfs\fR is also what makes
1924+
\fBnode:vfs\fR available to the worker's own code. A worker whose script comes
1925+
from anywhere else, such as the real file system, needs nothing added.
19251926
\fB--vfs-load\fR is not permitted in \fBNODE_OPTIONS\fR: which entry point runs is
19261927
the command line's decision, and the environment must not be able to redirect
19271928
it.

0 commit comments

Comments
 (0)