1// OR...
2const { exec, spawn } = require('child_process');
3exec('my.bat', (err, stdout, stderr) => {
4 if (err) {
5 console.error(err);
6 return;
7 }
8 console.log(stdout);
9});
10
11// Script with spaces in the filename:
12const bat = spawn('"my script.cmd"', ['a', 'b'], { shell: true });
13// or:
14exec('"my script.cmd" a b', (err, stdout, stderr) => {
15 // ...
16});
17
1var execSync = require('exec-sync');
2
3var user = execSync('python celulas.py');