command_wrapper 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 36

command_wrapper

command_wrapper package makes it easy to create a Dart wrapper for command line tools.

Usage

CommandWrapper lets you create a Dart wrapper for command line tools. For example, you can create a wrapper for curl by passing the executable name to the CommandWrapper constructor. The path of curl is autmatically located in a platform independent manner using which package.

CommandWrapper curl = new CommandWrapper('curl');
CommandResult result = await curl.run(['--version']);

CommandResult contains stdout, stderr and exitCode. The type of stdout and stderr is List<String> so you can easily process each line.

Command

command_wrapper provides wrappers for commonly used Dart commands.

  • dart
  • pub
  • dart2js
  • dartfmt
  • dartanalyzer
  • dartdoc

Examples

import 'package:command_wrapper/command_wrapper.dart';

main() async {
  // Use dart CommandWrapper instance.
  CommandResult result = await dart.run(['--version']);
  print(result.stderr.join(''));

  // Create a new CommandWrapper.
  CommandWrapper curl = new CommandWrapper('curl');
  result = await curl.run(['--version']);
  print(result.stdout.join(''));
}

Changelog

0.2.0

  • Add stdin argument to run method

0.1.0

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  command_wrapper: "^0.2.0"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:command_wrapper/command_wrapper.dart';
  
Version Uploaded Documentation Archive
0.2.0 Oct 21, 2016 Go to the documentation of command_wrapper 0.2.0 Download command_wrapper 0.2.0 archive
0.1.0 Oct 20, 2016 Go to the documentation of command_wrapper 0.1.0 Download command_wrapper 0.1.0 archive

Analysis

We analyzed this package on Jun 12, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
0 / 100
Health:
Code health derived from static analysis. [more]
97 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
36 / 100
Overall score:
Weighted score of the above. [more]
36
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • Fix .analysis_options.

    We were unable to parse .analysis_options.

  • Package is getting outdated.

    The package was released 85 weeks 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 API.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 2 hints.

    Strong-mode analysis of lib/src/command_wrapper_base.dart gave the following hint:

    line: 62 col: 20
    'UTF8' is deprecated and shouldn't be used.

  • Use analysis_options.yaml.

    Rename old .analysis_options file to analysis_options.yaml.

  • Enable strong mode analysis.

    Strong mode helps you to detect bugs and potential issues earlier.Start your analysis_options.yaml file with the following:

    analyzer:
      strong-mode: true
    

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.0.0 <2.0.0
which >=0.1.3 <0.2.0 0.1.3
Transitive dependencies
path 1.6.0
when 0.2.0
Dev dependencies
test >=0.12.0 <0.13.0