Skip to content
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

Add ipc option #794

Merged
merged 1 commit into from Feb 7, 2024
Merged

Add ipc option #794

merged 1 commit into from Feb 7, 2024

Conversation

ehmicky
Copy link
Collaborator

@ehmicky ehmicky commented Feb 7, 2024

Fixes #782.

@@ -309,7 +309,6 @@ type CommonOptions<IsSync extends boolean = boolean> = {
- `'pipe'`: Sets [`childProcess.stdin`](https://nodejs.org/api/child_process.html#subprocessstdin) stream.
- `'overlapped'`: Like `'pipe'` but asynchronous on Windows.
- `'ignore'`: Do not use `stdin`.
- `'ipc'`: Sets an [IPC channel](https://nodejs.org/api/child_process.html#subprocesssendmessage-sendhandle-options-callback). You can also use `execaNode()` instead.
Copy link
Collaborator Author

@ehmicky ehmicky Feb 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undocument passing ipc to the stdio option. However, it is still supported.

@@ -286,6 +288,12 @@ export function execaSync(rawFile, rawArgs, rawOptions) {
};
}

const validateSyncOptions = ({ipc}) => {
if (ipc) {
throw new TypeError('The "ipc: true" option cannot be used with synchronous methods.');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

child_process.spawnSync() does not allow IPC. It would not make sense anyway, since childProcess.send() would not be available.

@sindresorhus sindresorhus merged commit c8a7961 into main Feb 7, 2024
14 checks passed
@sindresorhus sindresorhus deleted the ipc-option branch February 7, 2024 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ipc option
2 participants