execa
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -42,2 +42,15 @@ /// <reference types="node"/> | ||
/** | ||
Path to the Node.js executable to use in child processes. | ||
This can be either an absolute path or a path relative to the `cwd` option. | ||
Requires `preferLocal` to be `true`. | ||
For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process. | ||
@default process.execPath | ||
*/ | ||
readonly execPath?: string; | ||
/** | ||
Buffer the output from the spawned process. When set to `false`, you must read the output of `stdout` and `stderr` (or `all` if the `all` option is `true`). Otherwise the returned promise will not be resolved/rejected. | ||
@@ -44,0 +57,0 @@ |
@@ -17,7 +17,7 @@ 'use strict'; | ||
const getEnv = ({env: envOption, extendEnv, preferLocal, localDir}) => { | ||
const getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => { | ||
const env = extendEnv ? {...process.env, ...envOption} : envOption; | ||
if (preferLocal) { | ||
return npmRunPath.env({env, cwd: localDir}); | ||
return npmRunPath.env({env, cwd: localDir, execPath}); | ||
} | ||
@@ -41,2 +41,3 @@ | ||
localDir: options.cwd || process.cwd(), | ||
execPath: process.execPath, | ||
encoding: 'utf8', | ||
@@ -43,0 +44,0 @@ reject: true, |
{ | ||
"name": "execa", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Process execution for humans", | ||
@@ -55,2 +55,3 @@ "license": "MIT", | ||
"coveralls": "^3.0.4", | ||
"get-node": "^5.0.0", | ||
"is-running": "^2.1.0", | ||
@@ -57,0 +58,0 @@ "nyc": "^14.1.1", |
@@ -311,2 +311,15 @@ <img src="media/logo.svg" width="400"> | ||
#### execPath | ||
Type: `string`<br> | ||
Default: `process.execPath` (current Node.js executable) | ||
Path to the Node.js executable to use in child processes. | ||
This can be either an absolute path or a path relative to the [`cwd` option](#cwd). | ||
Requires [`preferLocal`](#preferlocal) to be `true`. | ||
For example, this can be used together with [`get-node`](https://github.com/ehmicky/get-node) to run a specific Node.js version in a child process. | ||
#### buffer | ||
@@ -313,0 +326,0 @@ |
50553
952
568
10