0

I'm trying to execute a file as child process with separate output, for example, I start my main project from a cmd process with "node .", and when I fill in a certain command in my main CLI, I want another cmd process to pop up with the child service output. Problem is the child output also needs to support input.

File 1 (Main project file): index.js

File 2 (Child Process file): kahoot.js

File 2 (Child process code snippet):

 rl.question("Please enter game-pin: ", function(pin) {
  rl.question("Please enter bot-name: ", function(name) {
    rl.question("Please enter amount of bots: ", function(amount) {
      var session = new kahoot.Session(pin /** pin */, /** optional cors proxy, url string */)
      addPlayerGroup(name, amount, canBeRemoved, selectOnAdd, session)
      rl.close();
    });
  });
});

Not really anymore code to show, I just want this to work.. Thanks

WoJo
  • 500
  • 1
  • 3
  • 20
  • Does this answer your question? [Node.js spawn child process and get terminal output live](https://stackoverflow.com/questions/14332721/node-js-spawn-child-process-and-get-terminal-output-live) – TKoL Dec 17 '19 at 16:48
  • @TKoL I tried doing this again (I tried before) and it doesn't work. First method gives me errors but no output and second and third method doesn't give me anything. All of them don't spawn a separate cmd process output. – WoJo Dec 17 '19 at 16:54
  • Sorry mate, I gave it a good go but I'm not having much luck on Windows10 over here – TKoL Dec 17 '19 at 17:10
  • Dangit, I've been struggling with this one for days.. – WoJo Dec 17 '19 at 18:00

0 Answers0