Skip to content
Myr

Fix documentation of `execa.node()` (#297)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by Sindre Sorhus · parent 1880029 · Browse files · 2 files+11 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+11 added−6 removed

  • other:+11 added−6 removed

2 files+11 added−6 removed

modified:index.d.ts+8 added-3 removed
434 unmodified lines
435436 /**437 Execute a Node.js script as a child process.438439 Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):440 - the current Node version and options are used. This can be overridden using the `nodePath` and `nodeArguments` options.441 - the `shell` option cannot be used442 - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)443444 @param scriptPath - Node.js script to execute.445 @param arguments - Arguments to pass to `scriptPath` on execution.446 @returns A [`child_process` instance](https://nodejs.org/api/child_process.html#child_process_class_childprocess), which is enhanced to also be a `Promise` for a result `Object` with `stdout` and `stderr` properties.447 */
2 unmodified lines
450 arguments?: readonly string[],451 options?: execa.NodeOptions452 ): execa.ExecaChildProcess;453 node(449 file: string,454 scriptPath: string,455 arguments?: readonly string[],456 options?: execa.Options<null>457 ): execa.ExecaChildProcess<Buffer>;453 node(file: string, options?: execa.Options): execa.ExecaChildProcess;454 node(file: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;458 node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess;459 node(scriptPath: string, options?: execa.Options<null>): execa.ExecaChildProcess<Buffer>;460};461462export = execa;
modified:readme.md+3 added-3 removed
186 unmodified lines
187### execa.node(scriptPath, [arguments], [options])188189Execute a Node.js script as a child process.190191Same as `execa('node', [file, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):192 - the [`nodePath`](#nodepath-for-node-only) and [`nodeArguments`](#nodearguments-for-node-only) options can be used193 - the [`shell`](#shell) option cannot be used 191Same as `execa('node', [scriptPath, ...arguments], options)` except (like [`child_process#fork()`](https://nodejs.org/api/child_process.html#child_process_child_process_fork_modulepath_args_options)):192 - the current Node version and options are used. This can be overridden using the [`nodePath`](#nodepath-for-node-only) and [`nodeArguments`](#nodearguments-for-node-only) options.193 - the [`shell`](#shell) option cannot be used194 - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio)195196### childProcessResult197
325 unmodified lines