packages 0.4.4

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 42

Packages

Resolves a package name to its path on your HD

Since version v0.3 it also supports pub global activate packages!

Use as library

pubspec.yaml

  ...  
  dependencies:
    packages: ^0.1.0

import 'package:packages/packages.dart';

final Packages packages = new Packages();
final Package package = packages.resolvePackageUri(
    Uri.parse("package:grinder")
    );

print(package.packagename); // grinder

print(package.lib.path); 
// file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib;

print(package.uri.path); 
// file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib;    

final Uri resource = await package.resource;
print(resource); 
// http://localhost:62232/packages/grinder
        
print(package.root);
// file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3

or if you want a specific file in a package

final Package package = packages.resolvePackageUri(
    Uri.parse("package:grinder/src/ansi.dart")
    );

print(package.packagename); // grinder

print(package.lib.path); 
// file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib;

print(package.uri.path); 
// file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib/src/ansi.dart;    

final Uri resource = await package.resource;
print(resource); 
// http://localhost:62232/packages/grinder/src/ansi.dart

// Global packages
final globals = await packages.globals;
final localPackages = globals.where((final GlobalPackage package) => package.hasPath);
localPackages.forEach((final package) => print(package.path.value));

Use as cmdline application

Usage: packages [options] <packagename>
    -h, --[no-]help       Shows this help information
    -l, --[no-]list       Lists all packages
    -g, --[no-]globals    Lists all global packages    
    -v, --[no-]verbose    More package details

Sample output:
packages -v package:grinder/src/ansi.dart

Name: grinder
    Lib: file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib
    Uri: file:///Users/mikemitterer/.pub-cache/hosted/pub.dartlang.org/grinder-0.8.0+3/lib/src/ansi.dart
    Resource: http://localhost:62788/packages/grinder/src/ansi.dart

Install 'Packages'

    pub global activate packages

Update 'Packages'

    # activate packages again
    pub global activate packages

Uninstall 'Packages'

    pub global deactivate packages   

###License

Copyright 2018 Michael Mitterer (office@mikemitterer.at),
IT-Consulting and Development Limited, Austrian Branch

_____           _                         
|  __ \         | |                        
| |__) |_ _  ___| | ____ _  __ _  ___  ___ 
|  ___/ _` |/ __| |/ / _` |/ _` |/ _ \/ __|
| |  | (_| | (__|   < (_| | (_| |  __/\__ \
|_|   \__,_|\___|_|\_\__,_|\__, |\___||___/
                         __/ |          
                        |___/           
                                                        
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
either express or implied. See the License for the specific language
governing permissions and limitations under the License.

If this plugin is helpful for you - please (Circle) me or star this repo here on GitHub

Change Log for packages

Resolves a package name to its path on your HD

Unreleased

Feature

v0.4 - 2017-12-15

Feature

  • Returns global + local packages with path 11a0332
  • Global-Package support a111767

v0.3 - 2017-12-13

Refactor

  • Updated dependencies, Jenkins preparation 148b812

v0.1.8 - 2016-12-15

Feature

  • hasPackages returns true if lib finds a .packages file 64f95c2

v0.1.7 - 2016-12-06

Docs

  • Better usage-sample in README 3ca029e

v0.1.6 - 2016-11-16

Docs

v0.1.5 - 2016-11-16

Docs

v0.1.4 - 2016-10-24

Feature

  • root-Informations for Packages 11da731

v0.1.1 - 2016-10-20

Feature

This CHANGELOG.md was generated with Changelog for Dart

Use this package as an executable

1. Install it

You can install the package from the command line:


$ pub global activate packages

2. Use it

The package has the following executables:


$ packages

Use this package as a library

1. Depend on it

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


dependencies:
  packages: ^0.4.4

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:packages/packages.dart';
  
Version Uploaded Documentation Archive
0.4.4 Nov 22, 2018 Go to the documentation of packages 0.4.4 Download packages 0.4.4 archive
0.4.1 Jun 7, 2018 Go to the documentation of packages 0.4.1 Download packages 0.4.1 archive
0.3.3 Dec 15, 2017 Go to the documentation of packages 0.3.3 Download packages 0.3.3 archive
0.3.1 Dec 15, 2017 Go to the documentation of packages 0.3.1 Download packages 0.3.1 archive
0.2.4 Dec 13, 2017 Go to the documentation of packages 0.2.4 Download packages 0.2.4 archive
0.2.1 Dec 13, 2017 Go to the documentation of packages 0.2.1 Download packages 0.2.1 archive
0.1.9 Feb 28, 2017 Go to the documentation of packages 0.1.9 Download packages 0.1.9 archive
0.1.8 Dec 15, 2016 Go to the documentation of packages 0.1.8 Download packages 0.1.8 archive
0.1.7 Dec 6, 2016 Go to the documentation of packages 0.1.7 Download packages 0.1.7 archive
0.1.6 Nov 16, 2016 Go to the documentation of packages 0.1.6 Download packages 0.1.6 archive

All 16 versions...

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

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

  • Dart: 2.1.0
  • pana: 0.12.7

Platforms

Detected platforms: Flutter, other

Primary library: package:packages/packages.dart with components: io, isolate.

Health suggestions

Format bin/packages.dart.

Run dartfmt to format bin/packages.dart.

Format lib/packages.dart.

Run dartfmt to format lib/packages.dart.

Format lib/src/Packages.dart.

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

Format lib/src/mock.dart.

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

Maintenance issues and suggestions

Homepage does not exists. (-20 points)

We were unable to access https://github.com/Mike Mitterer/dart-packages at the time of the analysis.

The description is too short. (-20 points)

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

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use packages.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
args ^1.0.0 1.5.1
console_log_handler ^1.0.0 1.1.3
logging >=0.11.3 <1.0.0 0.11.3+2
optional ^3.0.0 3.0.0+2
path ^1.3.0 1.6.2
Transitive dependencies
ansicolor 1.0.2
intl 0.15.7
Dev dependencies
build_runner any
build_test any
build_web_compilers any
grinder any
test any