Run and execute child process command through front end button

Viewed 21

At the moment I have a code in Node.js which run the cmd command through child process. Unfortunately I have to start an external console and execute the Node.js file "manually". However, I would like to be able to press a button in the front end & then cmd will perform a command after clicking button. like start chrome which i have given command in the code bellow

here is my child process code...

        const { exec } = require("child_process"); 
     
        exec("start chrome", (err, outs, errs) => { 
        console.log(outs); 
    }); 
    
0 Answers
Related