Child Processes in nodejs
The 'child_process' module provides the ability to spawn new processes. This is useful for running system commands, executing other scripts, or leveraging multi-core systems by distributing work across processes.
Example
const { exec } = require('child_process');
exec('ls -lh', (err, stdout, stderr) => {
if (err) return;
console.log(stdout);
});Using exec to run a shell command and capture its output.