example/main.js
async function main() { // eslint-disable-line no-unused-vars
  try {
    // `path` is the absolute path to the executable.
    const path = await which('foobar');
    console.log(`The command "foobar" is located at: ${path}`);
  }

  catch (err) {
    // `err` is an instance of `FinderError`.
    console.log(`The command "${err.command}" was not found`);
  }
}
async function main() { // eslint-disable-line no-unused-vars
  try {
    // `path` is the absolute path to the executable.
    const path = await which('foobar');
    console.log(`The command "foobar" is located at: ${path}`);
  }

  catch (err) {
    // `err` is an instance of `FinderError`.
    console.log(`The command "${err.command}" was not found`);
  }
}
async function main ( ) { // eslint-disable-line no-unused-vars try { // `path` is the absolute path to the executable. const path = await which ( 'foobar' ) ; console . log ( ` ${ path } ` ) ; } catch ( err ) { // `err` is an instance of `FinderError`. console . log ( ` ${ err . command } ` ) ; } }
Finds the instances of an executable.
Finds the instances of an executable .