Instead of a string, return an object (maybe with a .toString() function?) that has separately the command from its arguments, and ideally a needSudo attribute to know if its needed. This would allow more flexibility on its usage, specially regarding to its execution later with child_process.spawn(). I would be able to do this and other optimization and send a pull-request if you want.
Instead of a string, return an object (maybe with a
.toString()function?) that has separately the command from its arguments, and ideally aneedSudoattribute to know if its needed. This would allow more flexibility on its usage, specially regarding to its execution later withchild_process.spawn(). I would be able to do this and other optimization and send a pull-request if you want.