Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

shell command using node

const exec  = require("child_process").exec;
exec("ls -la", function (error, stdout, stderr) {
    if (error) {
        console.log("Error: " + error);
        return;
    }
    if (stderr) {
        console.log("stderr: " + stderr);
        return;
    }
    console.log("stdout: " + stdout);
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #shell #command #node
ADD COMMENT
Topic
Name
6+4 =