Stability and customizability improvements
- Handle
nothrow
option onProcessPromise
init stage #1288
const o = await $({ nothrow: true })`\033`
o.ok // false
o.cause // Error
- Handle
_snapshot.killSignal
value onkill()
#1287
const p = $({killSignal: 'SIGKILL'})`sleep 10`
await p.kill()
p.signal // 'SIGKILL'
- Introduced
Fail
class #1285
import { Fail } from 'zx'
Fail.EXIT_CODES['2'] = 'Custom error message'
Fail.formatErrorMessage = (err: Error, from: string): string =>
`${err.message} (${from})`
- Expose
$
as type #1283
import type { $, Options } from 'zx'
const custom$: $ = (pieces: TemplateStringsArray | Partial<Options>, ...args: any[]) => {
// ... custom implementation
}
-
Internal tweak ups #1276 #1277 #1278 #1279 #1280 #1281 #1282 #1286 #1289
-
Described the zx architecture basics. This section helps to better understand the zx concepts and internal logic, and will be useful for those who want to become a project contributor, make tools based on it, or create something similar from scratch. #1290 #1291 #1292