Skip to content

Commit

Permalink
Update termination.md
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus authored Aug 7, 2024
1 parent 67476b5 commit ce786fb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/termination.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ const getInactivityOptions = () => {
* transform(data) {
// When anything is printed, debounce `controller.abort()`
abort();

// Keep the output as is
yield data;
},
Expand All @@ -172,10 +173,15 @@ const getInactivityOptions = () => {
// Start debouncing
abort();

return {cancelSignal, stdout: onOutput, stderr: onOutput};
return {
cancelSignal,
stdout: onOutput,
stderr: onOutput,
};
};

const options = getInactivityOptions();

await execa(options)`npm run build`;
```

Expand Down

0 comments on commit ce786fb

Please sign in to comment.