dexeca 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • new61

dexeca #

Pub Version .github/workflows/main.yml semantic-release Conventional Commits KeepAChangelog License

A dartlang child process executor inspired by

Usage #

import 'package:dexeca/dexeca.dart';

void main() {
  await dexeca('ping', ['']);

see ./example/main.dart for more details

1.0.1 (2020-03-18) #

Bug Fixes #

  • example: tidy up double dart io import (924d387)
  • pubspec: longer description to pass the linter (9c8e0a3)

1.0.0 (2020-03-13) #

Features #


import 'dart:io';
import 'dart:async';
import 'dart:convert';
import 'package:dexeca/dexeca.dart';

/// Just a helper so that this example will execute as expected everywhere.
List<String> _pingArgs(String target) {
  if (Platform.isWindows) {
    return [target];
  } else {
    return ['-c', '4', target];

Future<void> main(List<String> args) async {
  // We are not exactly the same as `sindresorhus/execa`. By default dexeca
  // will interleave all STDIO to the parent process, ie: inheritStdio = true.
  // This is the most common case I personally run into all the time.
  var result = await dexeca('ping', _pingArgs(''));

  // By default after the command has executed
  // you can also access the captured output.

  // Don't want to stream the STDIO but still want to capture the output
  var result2 = await dexeca('ping', _pingArgs(''), inheritStdio: false);

  // Want to capture combined output?
  var result3 = await dexeca(
    inheritStdio: false,
    combineOutput: true,

  // Got your own stream that you want the output written to?
  // Keep in mind if you listen to the process's stdout or stderr then
  // `dexeca` cannot as such `inheritStdio`, `captureOutput` & `captureOutput`
  // are meaningless.
  var customStdOut = StreamController<List<int>>();
  var proc1 = dexeca('ping', _pingArgs(''));
  var pipe1 = proc1.stdout.pipe(customStdOut);
  await for (var x in
      .transform(LineSplitter())) {
  await pipe1;
  await proc1;

  // Redirect output to a file
  var proc2 = dexeca('ping', _pingArgs(''));
  await proc2.stdout.pipe(File('./fordping-results.txt').openWrite());
  await proc2;

  // Handling errors - dexeca will throw a ProcessResult (instead of returning
  // one) when ever a command exits with a non 0 code.
  try {
    var procResultIfSuccess = await dexeca('ping', _pingArgs('a.b.c.d'));
    print(procResultIfSuccess.exitCode); // should always be 0
  } on ProcessResult catch (procResultIfFailure) {
    print(procResultIfFailure.exitCode); // could be anything but 0

  // Cancelling a spawned process
  var proc4 = dexeca('ping', _pingArgs(''));
  Future.delayed(Duration(seconds: 2), () {
  try {
    await proc4;
  } on ProcessResult catch (e) {

  // Run many commands at once with interleaved output
  await Future.wait([
    dexeca('ping', _pingArgs('')),
    dexeca('ping', _pingArgs('')),

Use this package as a library

1. Depend on it

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

  dexeca: ^1.0.1

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:dexeca/dexeca.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 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
Dev dependencies
drun ^1.0.11
pedantic ^1.8.0
test ^1.14.1