Answers for "run command line using javascript"

0

run command line using javascript

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}`);
});
Posted by: Guest on January-20-2021

Code answers related to "run command line using javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language