From a2dc6426f434648bd6324253d3c54d27e0f303cd Mon Sep 17 00:00:00 2001 From: ehmicky Date: Wed, 19 Jun 2019 05:09:15 -0700 Subject: [PATCH] Fix documentation of `execa.node()` (#297) --- index.d.ts | 11 ++++++++--- readme.md | 6 +++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index 9a2184690d..6a7e21ef10 100644 --- a/index.d.ts +++ b/index.d.ts @@ -436,6 +436,11 @@ declare const execa: { /** Execute a Node.js script as a child process. + 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)): + - the current Node version and options are used. This can be overridden using the `nodePath` and `nodeArguments` options. + - the `shell` option cannot be used + - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio) + @param scriptPath - Node.js script to execute. @param arguments - Arguments to pass to `scriptPath` on execution. @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. @@ -446,12 +451,12 @@ declare const execa: { options?: execa.NodeOptions ): execa.ExecaChildProcess; node( - file: string, + scriptPath: string, arguments?: readonly string[], options?: execa.Options ): execa.ExecaChildProcess; - node(file: string, options?: execa.Options): execa.ExecaChildProcess; - node(file: string, options?: execa.Options): execa.ExecaChildProcess; + node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess; + node(scriptPath: string, options?: execa.Options): execa.ExecaChildProcess; }; export = execa; diff --git a/readme.md b/readme.md index e0e8571095..100cd3666a 100644 --- a/readme.md +++ b/readme.md @@ -188,9 +188,9 @@ Returns or throws a [`childProcessResult`](#childProcessResult). Execute a Node.js script as a child process. -Same 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)): - - the [`nodePath`](#nodepath-for-node-only) and [`nodeArguments`](#nodearguments-for-node-only) options can be used - - the [`shell`](#shell) option cannot be used +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)): + - 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. + - the [`shell`](#shell) option cannot be used - an extra channel [`ipc`](https://nodejs.org/api/child_process.html#child_process_options_stdio) is passed to [`stdio`](#stdio) ### childProcessResult