Answers for "shell script run node"

1

running shell commands nodejs

const exec = require('child_process').exec;
const child = exec('cat *.js bad_file | wc -l',
    (error, stdout, stderr) => {
        console.log(`stdout: ${stdout}`);
        console.log(`stderr: ${stderr}`);
        if (error !== null) {
            console.log(`exec error: ${error}`);
        }
});
Posted by: Guest on December-27-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language