Skip to content

Commit

Permalink
Merge 6c7f493 into f1eda9c
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Nov 24, 2019
2 parents f1eda9c + 6c7f493 commit 51be7b4
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.d.ts
Expand Up @@ -135,6 +135,19 @@ declare namespace execa {
*/
readonly stdio?: 'pipe' | 'ignore' | 'inherit' | readonly StdioOption[];

/**
Specify the kind of serialization used for sending messages between processes when using the `stdio: 'ipc'` option or `execa.node()`:
- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)
Requires Node.js `13.2.0` or later.
[More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)
@default 'json'
*/
readonly serialization?: 'json' | 'advanced';

/**
Prepare child to run independently of its parent process. Specific behavior [depends on the platform](https://nodejs.org/api/child_process.html#child_process_options_detached).
Expand Down
1 change: 1 addition & 0 deletions index.test-d.ts
Expand Up @@ -115,6 +115,7 @@ execa('unicorns', {stdio: 'inherit'});
execa('unicorns', {
stdio: ['pipe', 'ipc', 'ignore', 'inherit', process.stdin, 1, undefined]
});
execa('unicorns', {serialization: 'advanced'});
execa('unicorns', {detached: true});
execa('unicorns', {uid: 0});
execa('unicorns', {gid: 0});
Expand Down
13 changes: 13 additions & 0 deletions readme.md
Expand Up @@ -451,6 +451,19 @@ Default: `pipe`

Child's [stdio](https://nodejs.org/api/child_process.html#child_process_options_stdio) configuration.

#### serialization

Type: `string`<br>
Default: `'json'`

Specify the kind of serialization used for sending messages between processes when using the [`stdio: 'ipc'`](#stdio) option or [`execa.node()`](#execanodescriptpath-arguments-options):
- `json`: Uses `JSON.stringify()` and `JSON.parse()`.
- `advanced`: Uses [`v8.serialize()`](https://nodejs.org/api/v8.html#v8_v8_serialize_value)

Requires Node.js `13.2.0` or later.

[More info.](https://nodejs.org/api/child_process.html#child_process_advanced_serialization)

#### detached

Type: `boolean`
Expand Down

0 comments on commit 51be7b4

Please sign in to comment.