-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
Closed
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.wontfixIssues that will not be fixed.Issues that will not be fixed.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.
Description
What is the problem this feature will solve?
Some test runners like AVA run tests files in separate worker threads, for improved performance and context isolation. It's common in tests to use process.chdir()
to change the directory to be able to test how a certain thing works when running from a different place, or maybe you just want it to run in a temporary directory.
What is the feature you are proposing to solve the problem?
I'm aware process.chdir()
works per process and not per thread, but maybe it would be possible to expose a process.withCwd(tempDirectory, () => {})
method, where the CWD change is only available inside the given synchronous callback?
What alternatives have you considered?
multi-process model + shared memory. That lets you support SharedArrayBuffer without the headaches of the multi-thread model.
szmarczak, SamVerschueren, t1m0thyj, silverwind and chriswheeldon-peakon
Metadata
Metadata
Assignees
Labels
feature requestIssues that request new features to be added to Node.js.Issues that request new features to be added to Node.js.processIssues and PRs related to the process subsystem.Issues and PRs related to the process subsystem.wontfixIssues that will not be fixed.Issues that will not be fixed.workerIssues and PRs related to Worker support.Issues and PRs related to Worker support.