1

I'm building a command-line app in Node which is basically a setup wizard. At some point in the script, I'd like to start an openssl script which has its own stdout and prompts, and then ideally return to my Node app when it's done.

I've tried using spawn but am having trouble showing the stdout. Is this practically possible?

1 Answer 1

2

Yes, this is possible, you can pipe standard input and output to your parent process like this,

// Child will use parent's stdios
spawn('yourcommand', [], { stdio: 'inherit' });

first parameter is your command, second parameter is command parameters and third parameters is how to handle standard inputs and outputs,

Refer this documentation for more information, https://nodejs.org/api/child_process.html#child_process_options_stdio

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.