Is there a way to run a command within a TypeScript file and display the output on the screen?
- I want the TypeScript file to terminate after running the command.
- The command's output should be displayed as if it was executed from the command prompt.
I've attempted the following method but it didn't work:
var exec = require('child_process').exec
exec('npm run start', (err, stdout, stderr) =>console.log(stdout));