DartLang.PubSpec
1.0.0
See the version list below for details.
dotnet add package DartLang.PubSpec --version 1.0.0
NuGet\Install-Package DartLang.PubSpec -Version 1.0.0
<PackageReference Include="DartLang.PubSpec" Version="1.0.0" />
paket add DartLang.PubSpec --version 1.0.0
#r "nuget: DartLang.PubSpec, 1.0.0"
// Install DartLang.PubSpec as a Cake Addin #addin nuget:?package=DartLang.PubSpec&version=1.0.0 // Install DartLang.PubSpec as a Cake Tool #tool nuget:?package=DartLang.PubSpec&version=1.0.0
DartLang.PubSpec
A library to read Dart pubspec.yaml files.
Usage
var yaml = File.ReadAllText("pubspec.yaml");
var pubspec = PubSpec.Deserialize(yaml);
Console.WriteLine($"Name: {pubspec.Name}");
Console.WriteLine($"Version: {pubspec.Version}");
Custom Deserializer
You can also build your own deserializer using YamlDotNet
directly:
var deserializer = new DeserializerBuilder()
.IgnoreUnmatchedProperties() // pub.dev will ignore other properties
.WithNamingConvention(UnderscoredNamingConvention.Instance) // dart uses underscores for properties
.WithPubSpecConverters() // converters for custom types
.Build();
return deserializer.Deserialize<PubSpec>(reader);
Serialization
Serialization is currently not supported, but should not be hard to implement yourself.
License
MIT
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- Semver (>= 2.3.0)
- YamlDotNet (>= 15.1.6)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DartLang.PubSpec:
Package | Downloads |
---|---|
DartLang.PubSpec.Serialization.Json
A library to serialize and deserialize Dart pubspec.yaml files |
|
DartLang.PubSpec.Serialization.Yaml
A library to serialize and deserialize Dart pubspec.yaml files |
GitHub repositories
This package is not used by any popular GitHub repositories.
# 1.0.0
* Initial release 🎉
* Support for deserializing pubspec.yaml files using `PubSpec.Deserialize(String yaml)` and `PubSpec.Deserialize(StringReader reader)`.
* You can also build your own deserializer using:
```csharp
var deserializer = new DeserializerBuilder()
.IgnoreUnmatchedProperties() // pub.dev will ignore other properties
.WithNamingConvention(UnderscoredNamingConvention.Instance) // convention
.WithPubSpecConverters() // converters for custom types
.Build();
return deserializer.Deserialize<PubSpec>(reader);
```