Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

execute command js

    try {
        exec(CMD, (error, stdout, stderr) => {
            if (error) {
                console.log(error);
            }
            if (stdout) {
                console.log(`out of the command : ${stdout}`);
            }
            if (stderr) {
                console.log(`error with cmd : ${stderr}`);
                return;
            }
        });
    } catch {
        console.log('error with cmd: cmd dosent launch');
    }
 
PREVIOUS NEXT
Tagged: #execute #command #js
ADD COMMENT
Topic
Name
2+4 =