Runs a command in a terminal (cmd.exe, gnome-terminal, Terminal) window.
$ npm i run-in-terminal
const { runInTerminal } = require('run-in-terminal');
runInTerminal('npm run watch');
runInTerminal('npm run watch').then(() => {
// the terminal closed
});
Returns a promise for the spawned child process.
Type: string
The command to run in a terminal window.
Type: Array
List of string arguments.
Type: Object
See child_process.spawn()
options.
Type: string
Default: process.cwd()
Current working directory of the child process.
MIT