Hello im making a node app that requires: ffmpeg, node-acoutstid with fpcalc and eye3D
.
Now is my question how i can see if those 'programs' are installed on the clients machine.
whats the best way to check this ?
Hello im making a node app that requires: ffmpeg, node-acoutstid with fpcalc and eye3D
.
Now is my question how i can see if those 'programs' are installed on the clients machine.
whats the best way to check this ?
"shell out" for native detection
In macOS / Linux / bash we'd typically use
type -p
orcommand -v
(orwhich
if you're doing it wrong).In windows there's
where
that you can use likewhere node.exe
.This naive approach can work if you're not trying to be cross-platform compatible and if you don't have to worry about sanitizing user input.
Use
command-exists
On npm there's a package command-exists. I peeked at the code and it looks like it's probably the simplest cross-platform detection that covers edge cases at a small size:
https://github.com/mathisonian/command-exists/blob/master/lib/command-exists.js