execa icon indicating copy to clipboard operation
execa copied to clipboard

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

Open jamestalmage opened this issue 9 years ago • 0 comments

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
});

jamestalmage avatar Apr 23 '16 19:04 jamestalmage