Skip to content

Progressive iteration over a piped process #1211

@MaddyGuthridge

Description

@MaddyGuthridge

While trying to work around #1210, I have encountered another issue. It appears that I am unable to progressively iterate over the stdout of a piped process.

const process = execa`cat temp.txt`
  .pipe(execa`tr \\r \\n`);

for await (const line of process) {
  console.log(line);
  // TypeError: line of execa`cat temp.txt`.pipe is not a function. (In 'line of execa`cat temp.txt`.pipe(execa`tr \\r \\n`)', 'line of execa`cat temp.txt`.pipe' is undefined)
}

Is this possible? If so, how can I do so? If not, can it be added please :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions