Skip to content
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

How to use capture with async/await? #39

Open
am opened this issue Jan 30, 2018 · 1 comment
Open

How to use capture with async/await? #39

am opened this issue Jan 30, 2018 · 1 comment

Comments

@am
Copy link

am commented Jan 30, 2018

Hi, I'm trying to capture the stdout of a spawn process that uses await, here is an example:

const { childProcess } = await spawn('yarn', ['install'], { capture: ['stdout'] });
console.log(childProcess.stdout.toString()); // returns [object Object]

I'm would like to log the complete stdout of the process once this completes. Previously used {stdio: 'inherit'} but since there are concurrent process it's not possible to differentiate the different processes stdout.

Any help is much appreciated, many thanks!

@Karolusrex
Copy link

Yes, that's a problem. I'd suggest using https://github.com/nkashyap/child-process-es6-promise instead

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

No branches or pull requests

2 participants