Skip to content

Allow using a final function without a transform - #916

Merged
sindresorhus merged 1 commit into
mainfrom
final-only
Mar 19, 2024
Merged

sindresorhus merged 1 commit into
mainfrom
final-only

Conversation

@ehmicky

@ehmicky ehmicky commented Mar 19, 2024 •

Copy link
Copy Markdown
Collaborator

Transforms can optionally specify a final function to output some data at the end of stdout/stderr.

At the moment, a final function can only be used if a transform function is used too. However, there are some use cases for using a final function alone. For example, one can append data with:

const final = function * () {
  yield 'Last line.';
};

const {stdout} = await execa(..., {stdout: {final}});
console.log(stdout); // Ends with "Last line."

This PR enables this.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants