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

Getting stdout streaming #47

Closed
AviramNahon opened this issue Mar 6, 2019 · 1 comment
Closed

Getting stdout streaming #47

AviramNahon opened this issue Mar 6, 2019 · 1 comment

Comments

@AviramNahon
Copy link

Hi,
I'm running a command that starts a program that prints to stdout over time.
I want to print out this output while it is happening.
if I use cmd.get() I will get the output only after the program has finished.
If I use cmd.run() I don't get any output and I have no way to know when the program finished.

how should I do that?

@AviramNahon
Copy link
Author

I wrote the issue after strugglenig with this whole day and solve it 5 minutes after writing it...
Anyway, the answer would be:
cmd.get(command,callback function).stdout.on('data', (data) => console.log(data) );

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

1 participant