process_run 0.10.0+1

  • Readme
  • Changelog
  • Example
  • Installing
  • 94

process_run #

Process run helpers for Linux/Win/Mac.

Build Status

Goals #

Currently using does not stream output which is not convenient for lengthy operation. It requires using Process.start in a more complex way.

run and runCmd add verbose helper for that. Also dart binaries (pub, dart2js...) and any script can be called consistently on Mac/Windows/Linux

ProcessCmd allow creating command object that can be run and modified.

Usage #

run #

Additional options to are

  • specifying stdin
  • making it verbose

Additional feature

  • It tries to resolve simple command like dart, firebase, flutter, or any script available on the user path on any Platform.
import 'package:process_run/process_run.dart';

Display dart version and the command executed:

await run('dart', ['--version'], verbose: true);

which #

Like unix which, it searches for installed executables

import 'package:process_run/which.dart';

Find flutter and firebase executables:

var flutterExectutable = whichSync('flutter');
var firebaseExectutable = whichSync('firebase');

shell #

Allows to run script from Mac/Windows/Linux in a portable way. Empty lines are added for lisibility

import 'package:process_run/shell.dart';

Run a simple script:

var shell = Shell();


# Display some text
echo Hello

# Display dart version
dart --version

# Display pub version
pub --version


More information on shell here

Additional features #

Addtional features and information are available here

Changelog #

0.10.0 #

  • feat: add Shell class and features
  • try to resolve single command everywhere

0.9.0 #

  • fix: which now returns the full path on linux

0.8.0 #

  • Deprecate old commands helper dartCmd, pubCmd... to use constructors instead (DartCmd, PubCmd...)
  • Add webdev and pbr command

0.7.0 #

  • add flutter command support
  • add Windows support
  • add which utility

0.6.0 #

  • dart2 support

0.5.6 #

  • supports implicit-casts: false

0.5.5 #

  • when using io.stdout and io.stderr, flush them when running a command

0.5.4 #

  • Fix handling of stdin

0.5.2 #

  • fix dart2js to have a libraryRoot argument
  • add dartdevc

0.5.1 #

  • fix devRun

0.5.0 #

  • deprecated connectStdout and connectStrerr in ProcessCmd
  • add stdin, stdout, verbose and commandVerbose parameter for run

0.4.0 #

  • add stdin and deprecated buggy connectStdin

0.3.3 #

  • add argumentToString to handle basic quote or double quote

0.3.2 #

  • fix dartdoc to add --packages argument along with the snapshot

0.3.0 #

  • Add runCmd (cmd_run library)

0.2.0 #

  • Add ProcessCmd

0.1.0 #

  • Initial version, run and dartbin utilities


import 'dart:async';

import 'package:process_run/shell.dart';

Future main() async {
  // This works on Windows/Linux/Mac

  var shell = Shell();


# Display some text
echo Hello

# Display dart version
dart --version

# Display pub version
pub --version


  shell = shell.pushd('example');


# Listing directory in the example folder

  shell = shell.popd();

Use this package as a library

1. Depend on it

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

  process_run: ^0.10.0+1

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:

import 'package:process_run/process_run.dart';
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 Mar 11, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Maintenance suggestions

Package is getting outdated. (-3.84 points)

The package was last published 54 weeks ago.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0-dev <3.0.0
collection >=1.14.10 <3.0.0 1.14.12
io >=0.3.0 <2.0.0 0.3.3
meta >=1.1.0 <3.0.0 1.1.8
path >=1.6.1 <3.0.0 1.6.4
yaml >=2.0.0 <4.0.0 2.2.0
Transitive dependencies
charcode 1.1.3
source_span 1.6.0
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
args any
async any
build_runner >=0.9.0
build_test >=0.10.2
pedantic >=1.4.0
pub_semver any
test >=1.2.0