Skip to content

Releases

v10.2.1

Choose a tag to compare

@sindresorhus sindresorhus released this 23 Oct 09:14
  • Fix types compatibility with exactOptionalPropertyTypes 2b6988b

v10.2.0...v10.2.1

v10.2.0

Choose a tag to compare

@sindresorhus sindresorhus released this 18 Oct 05:44

Behavior changes

These are bug fixes, but they might affect code that relied on the previous incorrect behavior.

  • Exceeding maxBuffer now terminates the subprocess with killSignal, instead of leaving it running and the promise pending f6de9be
  • maxBuffer: 0 now limits the output of synchronous methods, like asynchronous methods 224dd20
  • Options of $ set to undefined now use $'s defaults, such as inheriting stdin f61a6e9

Fixes

  • Fix invalid file descriptor objects, such as closed file handles, crashing the current process instead of throwing d0a5968
  • Fix synchronous transforms: errors being hidden, filtered output being returned on failure, mixed text and byte chunks being reordered, and final() being skipped without input 0ba2b6e ed80079 9c54833
  • Fix result.all changing objects when only stdout or stderr is buffered 8629132
  • Fix writing objects to a web WritableStream 5ea2900
  • Fix an invalid subprocess.duplex() option making later stream conversions hang 5e4345b
  • Fix execaNode() not running its file when the current process uses --print e747872

Types

  • Fix result and subprocess types when the options are a union, including IPC f5772f3 355d917 cb8aaf6
  • Fix result types when options bound with execa(options) are overridden or reset with undefined 708fed7
  • Fix subprocess.stdin types with the input and inputFile options 236c831
  • Fix chunk types of subprocess.iterable() with object-mode transforms a2912e5
  • Fix fd-specific option types, and execaNode() types with node: undefined 80b01e9 523cf9b

v10.1.1...v10.2.0

v10.1.1

Choose a tag to compare

@sindresorhus sindresorhus released this 13 Oct 06:57
  • Fix execaNode() and the node option missing IPC in their types 2633abb
  • Fix escapedCommand and verbose quoting arguments when using the shell option b2c3a54
  • Fix wrong-typed options and arguments being silently ignored or coerced b57d643
  • Fix the verbose option printing colors when stderr is not a terminal a2eda67
  • Fix stdin iterables and input transforms edge cases 6925cc3
  • Fix IPC edge cases 5f80cde
  • Fix .pipe() and stream conversion edge cases d3ec10d
  • Fix template strings, parseCommandString() and execaNode() edge cases fb92da1
  • Fix invalid timeout and forceKillAfterDelay values d9a5689
  • Fix errors, early errors and result.all edge cases c4262ff

v10.1.0...v10.1.1

v10.1.0

Choose a tag to compare

@sindresorhus sindresorhus released this 06 Oct 16:08

Behavior changes

These are bug fixes, but they might affect code that relied on the previous incorrect behavior.

  • extendEnv: false without the env option no longer inherits process.env, per docs 67acf60
  • Windows: Arguments of .cmd and .bat files are now escaped like Rust does, which fixes batch files reading %~1 (#1261) 93bddc4
  • Invalid stdio values, such as negative file descriptors, now throw c6bd387
  • Using the same file as input and output now throws, even when the paths are written differently 587045a
  • Synchronous methods now enforce per-file-descriptor maxBuffer values 9547e51
  • Synchronous methods now throw on the signal option, like asynchronous methods 59de065
  • Synchronous methods now write the raw output bytes to files, like asynchronous methods af6264a

Fixes

  • Fix subprocess.kill() signaling the current process group when the subprocess failed to spawn 5464d43
  • Fix crashes when spawning fails with EMFILE/ENFILE (#1262), or when a file target cannot be opened 15c46cd 1cee524
  • Fix error.stdout and error.stderr being undefined when synchronous methods fail to spawn (#1263) bfe4633
  • Fix the subprocess promise hanging until an output stream is read 004f3b3
  • Fix subprocess.pipe() with the stdio option, and destination subprocesses left running 8d3f0a9 ecda56b
  • Fix result.all when only some file descriptors are buffered or split into lines 758768f
  • Fix the encoding option and line splitting in transforms 6adb3c3
  • Fix input and output transforms with synchronous methods 516a5e2 e0b5dbc
  • Fix template strings with emojis and line continuations b67f199
  • Fix killDescendants signaling unrelated processes on Windows 9c5c71c
  • Fix IPC with serialization: 'json', strict: true and the verbose option 9842f1a 698a1b8 b548d8b
  • Fix the subprocess error being hidden when the current directory was deleted 91d9ded
  • Fix shebang scripts on Windows when the file is small 7c1a631

v10.0.1...v10.1.0

v10.0.1

Choose a tag to compare

@sindresorhus sindresorhus released this 31 Jul 02:10
  • Fix preferLocal argument escaping edge-case on Windows (#1259) e771733

v10.0.0...v10.0.1

v10.0.0

Choose a tag to compare

@sindresorhus sindresorhus released this 17 Jul 00:55

Breaking

const subprocess = execa('node', ['file.js']);
- subprocess.on('spawn', onSpawn);
+ subprocess.nodeChildProcess.on('spawn', onSpawn);
- await execaCommand('npm run build');
+ await execa`npm run build`;

- await execaCommand(commandString);
+ await execa`${parseCommandString(commandString)}`;
  • Removed the old undocumented stdio: [..., 'ipc'] syntax. Use the ipc: true option instead. (#1245) dcf611c
- await execa('node', ['file.js'], {stdio: ['pipe', 'pipe', 'pipe', 'ipc']});
+ await execa('node', ['file.js'], {ipc: true});
  • When the input or inputFile option is combined with an inherited stdin (for example stdio: 'inherit'), the explicit input is now used, instead of being ignored. To combine multiple inputs, pass an array like stdin: ['inherit', {string: 'input'}]. (#1232) 3ed0544

Improvements

await execa('npm', ['run', 'build'], {killDescendants: true, timeout: 5000});
await execa`npm run build`
	.readableStream()
	.pipeTo(writableWebStream);
for await (const line of execa`npm run build`.pipe`sort`) {
	console.log(line);
}
const subprocess = execa({stdio: ['pipe', 'pipe', 'pipe', {value: 'pipe', input: true}]})`npm run scaffold`;

const writable = subprocess.writable({to: 'fd3'});

Fixes


v9.6.1...v10.0.0

v9.6.1

Choose a tag to compare

@sindresorhus sindresorhus released this 29 Nov 20:53
  • Fix VerboseOption type not being properly exported (#1215) 7891c39

v9.6.0...v9.6.1

v9.6.0

Choose a tag to compare

@sindresorhus sindresorhus released this 26 May 21:59

v9.5.3...v9.6.0

v9.5.3

Choose a tag to compare

@sindresorhus sindresorhus released this 08 May 20:11

v9.5.2...v9.5.3

v9.5.2

Choose a tag to compare

@ehmicky ehmicky released this 07 Dec 23:13

Bug fixes