pub_cache 0.2.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 84

pub_cache

A library to reflect on the local pub cache.

pub package Build Status 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: ${app.name}, 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.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:


dependencies:
  pub_cache: "^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:pub_cache/pub_cache.dart';
  
Version Uploaded Documentation Archive
0.2.0 Apr 19, 2018 Go to the documentation of pub_cache 0.2.0 Download pub_cache 0.2.0 archive
0.1.1 Oct 13, 2017 Go to the documentation of pub_cache 0.1.1 Download pub_cache 0.1.1 archive
0.1.0 Jul 10, 2015 Go to the documentation of pub_cache 0.1.0 Download pub_cache 0.1.0 archive
0.0.1+2 Apr 13, 2015 Go to the documentation of pub_cache 0.0.1+2 Download pub_cache 0.0.1+2 archive
0.0.1+1 Apr 13, 2015 Go to the documentation of pub_cache 0.0.1+1 Download pub_cache 0.0.1+1 archive
0.0.1 Apr 12, 2015 Go to the documentation of pub_cache 0.0.1 Download pub_cache 0.0.1 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]
68 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
84
Learn more about scoring.

Platforms

Detected platforms: Flutter, other

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

Suggestions

  • 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.

  • 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.

  • 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 pub_cache.dart.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 1 hint.

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

    line: 222 col: 17
    Always override hashCode if overriding ==.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.17.0 <2.0.0
path ^1.0.0 1.6.0
pub_semver ^1.0.0 1.4.1
yaml ^2.0.0 2.1.14
Transitive dependencies
charcode 1.1.1
collection 1.14.10
source_span 1.4.0
string_scanner 1.0.2
Dev dependencies
test ^0.12.0