1const { spawn } = require('child_process');
2const ls = spawn('ls', ['-lh', '/usr']);
3
4ls.stdout.on('data', (data) => {
5 console.log(`stdout: ${data}`);
6});
7
8ls.stderr.on('data', (data) => {
9 console.error(`stderr: ${data}`);
10});
11
12ls.on('close', (code) => {
13 console.log(`child process exited with code ${code}`);
14});
15
1var child = require('child_process').exec('python celulas.py')
2child.stdout.pipe(process.stdout)
3child.on('exit', function() {
4 process.exit()
5})
1var execSync = require('exec-sync');
2
3var user = execSync('python celulas.py');