process_plus 2.0.0

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

process_plus #

Pub build status

Helpers for package:process. Including ForwardingProcessManager, PooledProcessManager, MockProcessManager, and CompletedProcess.

ForwardingProcessManager #

A simple ProcessManager that delegates to another one. Typically used as a base class to extend functionality.

var manager = ForwwardingProcessManager(const LocalProcessManager());

PooledProcessManager #

A ProcessManager that uses a Pool to limit to the max amount of concurrently-running processes.

var manager = PooledProcessManager(const LocalProcessManager(), Platform.numberOfProcessors);

MockProcessManager #

A ProcessManager that can enqueue results in advance, rather than actually spawning OS processes.

var manager = MockProcessManager();
manager.enqueue(ProcessResult(0, 1337, stdout, stderr));

var p = await['foo', '--bar=baz']);
await p.exitCode; // 1337

CompletedProcess #

A Process implementation that simply outputs the result of a CompletedProcess.

var p = CompletedProcess(ProcessResult(0, 1337, stdout, stderr));
await p.exitCode; // 1337

2.0.0 #

  • Dart 2 update.


import 'dart:io';
import 'package:process_plus/process_plus.dart';
import 'package:test/test.dart';
import 'completed_process.dart';

void main() {
  var r = ProcessResult(0, 0, hello, world);
  MockProcessManager manager;

  setUp(() async {
    manager = MockProcessManager();

  test('canRun', () {
    expect(manager.canRun('foo'), true);
    expect(manager.canRun('foo'), false);

  test('kill', () {
    expect(manager.killPid(0), true);
    expect(manager.killPid(0), false);

  test('queue process', () async {
    var p = await manager.start(['foo']);
    expect(await p.exitCode, r.exitCode);
    expect(await p.stdout.first, hello);
    expect(await p.stderr.first, world);

  group('queue process result', () {
    setUp(() async {

    test('runSync', () => expect(manager.runSync(['foo']), r));
    test('run', () async => expect(await['foo']), r));

Use this package as a library

1. Depend on it

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

  process_plus: ^2.0.0

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_plus/process_plus.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 Nov 7, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21


Detected platforms: Flutter, other

Primary library: package:process_plus/process_plus.dart with components: io.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
pool ^1.0.0 1.4.0
process ^3.0.0 3.0.12
Transitive dependencies
async 2.4.0
collection 1.14.12
file 5.1.0
intl 0.16.0
meta 1.1.8
path 1.6.4
platform 2.2.1
stack_trace 1.9.3
Dev dependencies
pedantic ^1.0.0
test ^1.0.0