pub_cache 0.2.3

  • Readme
  • Changelog
  • Installing
  • 76

pub_cache #

A library to reflect on the local pub cache.

pub package Build Status

How do I use it? #

pub_cache lets you reflect on the information in your Pub cache. For example, to find all the applications that have been activated:

PubCache cache = new PubCache();

for (Application app in cache.getGlobalApplications()) {
  print('activated app: ${}, version: ${app.version}');

Some other interesting use cases:

  • finding all the activated applications whose defining package has a specific meta-data file
  • given a package name, locate the directory on disk for that package, and using that location to read resources contained in the package
  • finding the latest non-dev version of all the packages in the cache

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.2.3 #

0.2.2 #

  • Uses PUB_HOSTED_URL for finding hosted packages

0.2.1 #

  • Dart 2 dependency upgrades

0.2.0 #

  • upgraded to support Dart 2

0.1.1 #

  • fixed an issue with global_packages enumeration

0.1.0 #

  • release as 0.1.0

0.0.1+2 #

  • ensure that any missing version constraint is returned as Version.none

0.0.1+1 #

  • fix an issue with parsing pubspec.yaml files without a version property defined

0.0.1 #

  • initial version

Use this package as a library

1. Depend on it

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

  pub_cache: ^0.2.3

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:pub_cache/pub_cache.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 May 24, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.1
  • pana: 0.13.8-dev

Health suggestions

Fix lib/pub_cache.dart. (-9.08 points)

Analysis of lib/pub_cache.dart reported 19 hints, including:

line 23 col 14: Unnecessary new keyword.

line 25 col 14: Unnecessary new keyword.

line 27 col 14: Unnecessary new keyword.

line 48 col 26: Prefer to use whereType on iterable.

line 62 col 7: Unnecessary new keyword.

Fix lib/src/impl.dart. (-5.36 points)

Analysis of lib/src/impl.dart reported 11 hints, including:

line 23 col 19: Unnecessary new keyword.

line 27 col 19: Unnecessary new keyword.

line 31 col 12: Unnecessary new keyword.

line 35 col 12: Unnecessary new keyword.

line 71 col 21: Unnecessary new keyword.

Maintenance suggestions

Package is getting outdated. (-42.74 points)

The package was last published 74 weeks ago.

The package description is too short. (-16 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Update (-2 points)

1 image link is insecure (e.g., use https URLs instead.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and pub_cache.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
path ^1.0.0 1.7.0
pub_semver ^1.0.0 1.4.4
yaml ^2.0.0 2.2.1
Transitive dependencies
charcode 1.1.3
collection 1.14.12
meta 1.1.8
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
Dev dependencies
test ^1.0.0