Skip to content

matthewnitschke/pubspec_writer_extensions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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()));
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages