8000 Allow transform streams convert output to an array of any objects, instead of a single string · Issue #21 · sindresorhus/execa · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Allow transform streams convert output to an array of any objects, instead of a single string #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jamestalmage opened this issue Apr 23, 2016 · 3 comments · Fixed by #693 or #709

Comments

@jamestalmage
Copy link
Contributor

We need to think through the ideal API for this and #20 as well, but something like:

execa('./cli', [], {
  transforms: {
     // shortcut to a built-in transform we provide
    stdout: 'line',

    stderr: through2(function (chunk, encoding, callback) {
      // custom processing here
    })
  }
}).then(function (result) {
  result.stdout;
  // => an array of lines

  result.stderr;
  // => an array of whatever the custom transform emits
});
@ehmicky
Copy link
Collaborator
ehmicky commented Jan 17, 2024

Re-opening since transforms can currently only return a string or a Uint8Array. The underlying stream's objectMode is always false.

@ehmicky ehmicky reopened this Jan 17, 2024
@ehmicky
Copy link
Collaborator
ehmicky commented Jan 21, 2024

Fixed by #709.

@ehmicky
Copy link
Collaborator
ehmicky commented May 8, 2024

This feature has been just released in Execa 9.0.0. Please see (and share!) the release post and the changelog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
0