diff --git a/index.d.ts b/index.d.ts index 8e1050a94a..fbf199aa8c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -432,9 +432,15 @@ declare const execa: { console.log(stdout); //=> 'unicorns' + // Cancelling a spawned process + const subprocess = execa('node'); - setTimeout(() => { spawned.cancel() }, 1000); + + setTimeout(() => { + subprocess.cancel() + }, 1000); + try { await subprocess; } catch (error) {