spawn-await is synchronous module and will block the Node.js event loop, pausing execution of any additional code until the spawned process exits.
import {Spawn} from 'spawn-await';
const firstCommand = "ls"; // write your command
const {stdout, stderr, status } = Spawn(firstCommand);
Returns: <Object>
-
stdout
The contents of output. -
stderr
The contents of output. -
status
| The exit code of the subprocess, or null if the subprocess terminated due to a signal.