Skip to content
Myr

Allow `nodePath` option to be a file URL (#632)

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

authored by ehmicky · committed by GitHub · parent 30ecc81 · Browse files · 4 files+12 added−2 removed
This commit

State

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

Diff stats

4 files+12 added−2 removed

  • tests:+7 added−0 removed
  • other:+5 added−2 removed

4 files+12 added−2 removed

modified:test/node.js+7 added
modified:index.d.ts+1 added-1 removed
365 unmodified lines
366 The Node.js executable to use.367368 @default process.execPath369 */370 readonly nodePath?: string;370 readonly nodePath?: string | URL;371372 /**373 List of [CLI options](https://nodejs.org/api/cli.html#cli_options) passed to the Node.js executable.374
687 unmodified lines
modified:index.test-d.ts+3 added
287 unmodified lines
288expectType<ExecaReturnValue<Uint8Array>>(289 await execaNode('unicorns', ['foo'], {encoding: 'buffer'}),290);291292expectType<ExecaChildProcess>(execaNode('unicorns', {nodePath: './node'}));293expectType<ExecaChildProcess>(execaNode('unicorns', {nodePath: new URL('file:///test')}));294295expectType<ExecaChildProcess>(execaNode('unicorns', {nodeOptions: ['--async-stack-traces']}));296expectType<ExecaChildProcess>(execaNode('unicorns', ['foo'], {nodeOptions: ['--async-stack-traces']}));297expectType<ExecaChildProcess<Uint8Array>>(298 execaNode('unicorns', {nodeOptions: ['--async-stack-traces'], encoding: 'buffer'}),
60 unmodified lines
modified:readme.md+1 added-1 removed
787 unmodified lines
788This can also be enabled by setting the `NODE_DEBUG=execa` environment variable in the current process.789790#### nodePath *(For `.node()` only)*791792Type: `string`\792Type: `string | URL`\793Default: [`process.execPath`](https://nodejs.org/api/process.html#process_process_execpath)794795Node.js executable used to create the child process.796
65 unmodified lines