the system() you've actually missed
npm install cb-system
Uses child_process.spawn to spawn the process, and waits for it to exit.
If everything goes okay, callback is called with no arguments.
If the process exits abnormally, the callback is called with an error.
For clarity, command is allowed to be an array, for cases like vmadm boot, where vmadm clearly isn't a very useful description of what command is being run.
This only makes a difference for error reporting.
ExitErrorthen, depending on how it exited:
'`' + command + '` killed by signal `' + err.signal + '`: ' + err.stderror
'`' command + '` exited with ' + err.code + ': ' + err.stderrThis is literally a fork of then-system
reworked to use callbacks. Whole refactor wound up being about 6 lines shorter.
Another fun fact: the total size of this module (including dependencies) with promises was 4084 lines of code, and is now reduced to 3213 lines of code.