const process = require("child_process");

// console.log(process);

// process.exec("ls", (a, b) => {
//     console.log(a);
//     console.log(b);
// })

const exec = command => {
  return new Promise((resolve, reject) => {
    process.exec(command, (err, stdout, stderr) => {
      if(err) return reject(stderr);
      return resolve(stdout);
    });
  });
}

exec("ls")
.then( result => console.log(result))
.catch( err => console.error(err));

exec("lsasdfad")
.then( result => console.log(result))
.catch( err => console.error(err));
@@ -1,14 +1,21 @@
 const 
+childe_
 process 
@@ -230,16 +230,23 @@
 %3E %7B%0A    
+childe_
 process.

modify child_process