scripts/utils/fs-helper.js
function getBinary( packageName, binaryName, binaryDir ) {
  binaryName = binaryName || packageName;
  binaryDir = binaryDir || 'bin';
  const pkgPath = require.resolve( packageName );
  binaryDir = path.resolve(
    path.join( path.dirname( pkgPath ), binaryDir, '/' + binaryName )
  );
  return binaryDir;
}
function getBinary( packageName, binaryName, binaryDir ) {
  binaryName = binaryName || packageName;
  binaryDir = binaryDir || 'bin';
  const pkgPath = require.resolve( packageName );
  binaryDir = path.resolve(
    path.join( path.dirname( pkgPath ), binaryDir, '/' + binaryName )
  );
  return binaryDir;
}
function getBinary ( packageName , binaryName , binaryDir ) { binaryName = binaryName || packageName ; binaryDir = binaryDir || 'bin' ; const pkgPath = require . resolve ( packageName ) ; binaryDir = path . resolve ( path . join ( path . dirname ( pkgPath ) , binaryDir , '/' + binaryName ) ) ; return binaryDir ; }
Retrieve a reference path to a binary.
@param {string} packageName - The name of the software package.
@param {string} [binaryName] - The name of the binary to retrieve.
Same as the package name by default.
@param {string} [binaryDir] - The name of the binary directory to use.
`bin` by default.
@returns {string} Path to the binary to run.
Retrieve a reference path to a binary .