pubspec_writer_extensions 1.0.0 copy "pubspec_writer_extensions: ^1.0.0" to clipboard
pubspec_writer_extensions: ^1.0.0 copied to clipboard

Extension methods for writing pubspec_parse's back to data formats

Pubspec Writer Extensions #

Extension methods, for the official pubspec_parse objects, that facilitate writing the objects back to data formats.

Usage #

import 'package:pubspec_parse/pubspec_parse.dart';
import 'package:pubspec_writer_extensions/pubspec_writer_extensions.dart';

void main() {
    final pubspec = Pubspec.parse(someYaml);

    print(pubspec.toJson()); // outputs Map<String, dynamic>
}

this can be used in conjunction with yaml_writer to write with yaml output:

import 'package:pubspec_parse/pubspec_parse.dart';
import 'package:pubspec_writer_extensions/pubspec_writer_extensions.dart';
import 'package:yaml_writer/yaml_writer.dart';

void main() {
    final pubspec = Pubspec.parse(someYaml);

    final yamlWriter = YAMLWriter();
    print(yamlWriter.write(pubspec.toJson()));
}
0
likes
110
points
150
downloads

Publisher

unverified uploader

Weekly Downloads

Extension methods for writing pubspec_parse's back to data formats

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

pubspec_parse

More

Packages that depend on pubspec_writer_extensions