Skip to content

Instantly share code, notes, and snippets.

@haidv35
Created February 2, 2021 10:08
Show Gist options
  • Save haidv35/7f9d9f73d1164e95e6f685dafb9bc0e3 to your computer and use it in GitHub Desktop.
Save haidv35/7f9d9f73d1164e95e6f685dafb9bc0e3 to your computer and use it in GitHub Desktop.
const { exec } = require("child_process");
exec("ls -la", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment