pub_mirror 1.0.7
pub_mirror: ^1.0.7 copied to clipboard

Dart native

A multi-thread tool to download content from Pub. Then the result can be served by a http server and taken as the backend of pub, flutter or even Pub Mirror itself.

example/pub_mirror.dart

import 'package:pub_mirror/pub_mirror.dart' as pub_mirror;

main() async {
  final tool = pub_mirror.PubMirrorTool('/tmp/pub/', 'http://example.com/pub/',
      upstream: 'https://pub.dartlang.org/api',
      verbose: true,
      maxConnections: 10);

  // iterate over all the packages
  await for (var package in tool.listAllPackages()) {
    print('-> ${package.name}');
  }

  // download the single package
  await tool.downloadPackage('pub_mirror');

  // download all packages with 100 threads
  await tool.download(100, overwrite: false);
}
0
likes
75
pub points
0%
popularity

A multi-thread tool to download content from Pub. Then the result can be served by a http server and taken as the backend of pub, flutter or even Pub Mirror itself.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

i@huiyiqun.me

License

BSD (LICENSE)

Dependencies

args, executor, http, logging, path, pedantic, pub_client, quiver, quiver_log, retry

More

Packages that depend on pub_mirror