console 3.0.0

  • README.md
  • Installing
  • Versions
  • 81

Console

A high-level console library.

Features

  • Console Colors (ANSI)
  • Icons (UTF-8)
  • Keyboard Capture
  • Experimental Clipboard Support
  • Progress Bars
  • Flexible Prompts
  • Shell Prompts
  • Choosers
  • Fancy Formatting
  • Loading Bars
  • Timer (like pub's timer)
  • Fancy Trees (like the npm dependency trees)
  • Simple Unit Testing

Usage

This library does not work in browsers (for a hopefully obvious reason).

import "package:console/console.dart";

void main() {
  // Initialize the Console. Throws an exception if advanced terminal features are not supported.
  Console.init();
  
  // Use the library...
}

Unit Testing

You can test the output produced by this library (and thus your own project that uses this library). Here is an example:

import "package:test/test.dart";
import "package:console/console.dart";

void main() {
  final output = new BufferConsoleAdapter();

  setUpAll(() => Console.adapter = output);

  // Clear output between test runs
  setUp(() => output.clear());

  group('base functions', () {
    test('centerCursor', () {
      Console.centerCursor();
      expect(output.toString(), '${Console.ANSI_ESCAPE}10;40H');
    });
  });
}

Use this package as a library

1. Depend on it

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


dependencies:
  console: ^3.0.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:console/console.dart';
  
Version Uploaded Documentation Archive
3.0.0 Jun 13, 2018 Go to the documentation of console 3.0.0 Download console 3.0.0 archive
2.2.4 Aug 17, 2016 Go to the documentation of console 2.2.4 Download console 2.2.4 archive
2.2.3 Apr 22, 2015 Go to the documentation of console 2.2.3 Download console 2.2.3 archive
2.2.2 Apr 19, 2015 Go to the documentation of console 2.2.2 Download console 2.2.2 archive
2.2.0 Feb 2, 2015 Go to the documentation of console 2.2.0 Download console 2.2.0 archive
2.1.0 Dec 4, 2014 Go to the documentation of console 2.1.0 Download console 2.1.0 archive
2.0.3 Nov 30, 2014 Go to the documentation of console 2.0.3 Download console 2.0.3 archive
2.0.2 Nov 30, 2014 Go to the documentation of console 2.0.2 Download console 2.0.2 archive
2.0.1 Nov 28, 2014 Go to the documentation of console 2.0.1 Download console 2.0.1 archive
2.0.0 Nov 28, 2014 Go to the documentation of console 2.0.0 Download console 2.0.0 archive

All 14 versions...

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

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

  • Dart: 2.0.0
  • pana: 0.11.8

Platforms

Detected platforms: Flutter, other

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

Issues and suggestions

Maintain CHANGELOG.md.

Changelog entries help clients to follow the progress in your code.

The description is too short.

Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Format lib/src/clipboard.dart.

Run dartfmt to format lib/src/clipboard.dart.

Maintain an example.

None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use console.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.61 <3.0.0
vector_math ^2.0.7 2.0.8
Dev dependencies
test >=0.12.0 <0.13.0