nodejs how to run os sytem command in specific dir code example
Example: node execute shell commands
const { exec } = require("child_process");
exec("cat index.js", (error, data, getter) => {
if(error){
console.log("error",error.message);
return;
}
if(getter){
console.log("data",data);
return;
}
console.log("data",data);
});