How can I check that an executable is available, on the computer my on which my NodeJS application is installed?
I don't want to wait until I call child_process.exec() to find the executable is missing, rather I would prefer to do a preflight check at the application launch, so it can fail early and clearly. I was recently bitten by this, only finding out two days after server launch, so I would like to avoid this going forward.
At the moment I am looking at simply doing which <command>, assuming a Unix based environment, and then parsing the output. Is there a better way, possibly more portable?