Ohm-Management - Projektarbeit B-ME
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. # which
  2. Like the unix `which` utility.
  3. Finds the first instance of a specified executable in the PATH
  4. environment variable. Does not cache the results, so `hash -r` is not
  5. needed when the PATH changes.
  6. ## USAGE
  7. ```javascript
  8. var which = require('which')
  9. // async usage
  10. which('node', function (er, resolvedPath) {
  11. // er is returned if no "node" is found on the PATH
  12. // if it is found, then the absolute path to the exec is returned
  13. })
  14. // sync usage
  15. // throws if not found
  16. var resolved = which.sync('node')
  17. // if nothrow option is used, returns null if not found
  18. resolved = which.sync('node', {nothrow: true})
  19. // Pass options to override the PATH and PATHEXT environment vars.
  20. which('node', { path: someOtherPath }, function (er, resolved) {
  21. if (er)
  22. throw er
  23. console.log('found at %j', resolved)
  24. })
  25. ```
  26. ## CLI USAGE
  27. Same as the BSD `which(1)` binary.
  28. ```
  29. usage: which [-as] program ...
  30. ```
  31. ## OPTIONS
  32. You may pass an options object as the second argument.
  33. - `path`: Use instead of the `PATH` environment variable.
  34. - `pathExt`: Use instead of the `PATHEXT` environment variable.
  35. - `all`: Return all matches, instead of just the first one. Note that
  36. this means the function returns an array of strings instead of a
  37. single string.