pubspec_extract 1.3.1
pubspec_extract: ^1.3.1

Dart native
Flutter Android iOS

Extracts Dart pubspec.yaml file and generate pubspec.dart at build time

Pubspec Extract #

Extracts Dart pubspec.yaml file and generate pubspec.dart at build time.

Buy Me A Coffee

Usage with build_runner #

In your pubspec.yaml, add the following:

builders:
    pubspec_extract:

Then in your application, you can import pubspec.dart:

import 'pubspec.dart' as pubspec; // May not exist but it's okay!

void main() {
  print(pubspec.name);
  print(pubspec.description);
  print(pubspec.version);
}

Usage as a command line tool #

In your pubspec.yaml, add the following:

dev_dependencies:
    pubspec_extract:

then if you are using Flutter, run:

flutter pub run pubspec_extract

or

pub run pubspec_extract

Install the command-line tool globally #

run:

pub global activate pubspec_extract

the executable will be compiled and available at $HOME/.pub-cache/bin or %APPDATA%\Pub\Cache\bin. You can run it using:

pub global run pubspec_extract
1
likes
100
pub points
45%
popularity

Publisher

nfet.net

Extracts Dart pubspec.yaml file and generate pubspec.dart at build time

Repository (GitHub)
View/report issues

Documentation

API reference

License

Apache 2.0 (LICENSE)

Dependencies

args, build, dart_style, logging, path, pub_semver, yaml

More

Packages that depend on pubspec_extract