bash commands in node

npm install child_process

const { exec } = require('child_process'); exec('ls -la', (error, stdout, stderr) => { if (error) { console.error(error: ${error.message}); return; } if (stderr) { console.error(stderr: ${stderr}); return; } console.log(stdout:\n${stdout}); });