ProcessHelpers extension

Makes a program started with Process.start easier to work with.

final process = await Process.start('dart', ['run', 'bin/server.dart']);
process.stdout.lines.listen(log);
process.writeLine('hello');
final code = await process.waitFor(const Duration(seconds: 30));
on

Methods

closeInput() → Future<void>

Available on Process, provided by the ProcessHelpers extension

Tells the program there is nothing more to type in.
killTree() → Future<int>

Available on Process, provided by the ProcessHelpers extension

Stops the program, and any programs it started, and gives back its exit code.
waitFor(Duration limit) → Future<int?>

Available on Process, provided by the ProcessHelpers extension

Waits up to limit for the program to finish and gives back its exit code.
writeLine(String text) → void

Available on Process, provided by the ProcessHelpers extension

Types text into the program and presses Enter.