which 0.1.3

  • README.md
  • Installing
  • Versions
  • 47

which pub package Build Status Coverage Status

Check for and locate installed executables. Just like unix which(1), except:

  • Doesn't shell out (fast).
  • Cross-platform (works on windows).


pub global activate den
den install which


import 'dart:io';

import 'package:which/which.dart';

main(arguments) async {

  // Asynchronously
  var git = await which('git', orElse: () => null);

  // Or synchronously
  var git = whichSync('git', orElse: () => null);

  if (git == null) {
    print('Please install git and try again');

  await Process.run(git, ['add', '-A']);
  await Process.run(git, ['commit', '-m', arguments.first]);


  • Assume owner/group matches that of executable until it's possible to check. (#5)

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  which: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:which/which.dart';
Version Uploaded Documentation Archive
0.1.3 Feb 12, 2015 Go to the documentation of which 0.1.3 Download which 0.1.3 archive
0.1.2 Jan 15, 2015 Go to the documentation of which 0.1.2 Download which 0.1.2 archive
0.1.1 Jan 14, 2015 Go to the documentation of which 0.1.1 Download which 0.1.1 archive
0.1.0 Jan 13, 2015 Go to the documentation of which 0.1.0 Download which 0.1.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Aug 10, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0
  • pana: 0.11.8


Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Issues and suggestions

Fix dependencies in pubspec.yaml.

Running pub upgrade failed with the following output:

ERR: The current Dart SDK version is 2.0.0.
 Because which depends on when >=0.2.0 which requires SDK version <2.0.0, version solving failed.

Fix platform conflicts.

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Running dartdoc failed.

Make sure dartdoc runs without any issues.

Homepage does not exists.

We were unable to access https://github.com/seaneagan/which.dart at the time of the analysis.

Add SDK constraint in pubspec.yaml.

For information about setting SDK constraint, please see https://www.dartlang.org/tools/pub/pubspec#sdk-constraints.

Package is too old.

The package was released more than two years ago.

Package is pre-v1 release.

While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction of the API.

Maintain an example.

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use which.dart.

Format lib/src/candidate_paths.dart.

Run dartfmt to format lib/src/candidate_paths.dart.

Format lib/src/has_permission.dart.

Run dartfmt to format lib/src/has_permission.dart.

Fix additional 4 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/src/is_executable.dart (Run dartfmt to format lib/src/is_executable.dart.)
  • lib/src/util.dart (Run dartfmt to format lib/src/util.dart.)
  • lib/src/which_impl.dart (Run dartfmt to format lib/src/which_impl.dart.)
  • lib/which.dart (Run dartfmt to format lib/which.dart.)