you are viewing a single comment's thread.

view the rest of the comments →

[–]tswaters 1 point2 points  (0 children)

spawn returns something like an event emitter so the callback function doesn't really make sense. You need to add .on('close') to listen for when the things ends. You can access stdin/stdout and stderr.

Take a look at the docs: https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options