You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Synchronous iterator helpers just landed in Node 22. Async iterator helpers are currently a stage 2 ES proposal. Once they land in Node, we should add some tests, and document how to use them with Execa.
They could be quite nice to use with Execa. For example:
forawait(constlineofexeca`npm run build`.iterable().map(line=>line.toUpperCase()){// ...}
forawait(constlineofexeca`npm run build`.iterable().filter(line=>!line.includes('secret')){// ...}
// First 3 lines of output onlyforawait(constlineofexeca`npm run build`.iterable().take(3)){// `return` or `break` inside this loop will still await for the subprocess completion, which is good// ...}
Note: iterable.some(), iterable.every() and iterable.find() would also be useful to get a quick return value while the subprocess is still running. However, those won't wait for the subprocess to complete, so the user would need to call await subprocess, unlike the other iterator methods.
Also, those could be used with getEachMessage().
The text was updated successfully, but these errors were encountered:
Synchronous iterator helpers just landed in Node 22. Async iterator helpers are currently a stage 2 ES proposal. Once they land in Node, we should add some tests, and document how to use them with Execa.
They could be quite nice to use with Execa. For example:
Note:
iterable.some()
,iterable.every()
anditerable.find()
would also be useful to get a quick return value while the subprocess is still running. However, those won't wait for the subprocess to complete, so the user would need to callawait subprocess
, unlike the other iterator methods.Also, those could be used with
getEachMessage()
.The text was updated successfully, but these errors were encountered: