Meziantou.Framework.HumanReadableSerializer 1.0.19

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Meziantou.Framework.HumanReadableSerializer --version 1.0.19
NuGet\Install-Package Meziantou.Framework.HumanReadableSerializer -Version 1.0.19
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Meziantou.Framework.HumanReadableSerializer" Version="1.0.19" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Meziantou.Framework.HumanReadableSerializer --version 1.0.19
#r "nuget: Meziantou.Framework.HumanReadableSerializer, 1.0.19"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Meziantou.Framework.HumanReadableSerializer as a Cake Addin
#addin nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=1.0.19

// Install Meziantou.Framework.HumanReadableSerializer as a Cake Tool
#tool nuget:?package=Meziantou.Framework.HumanReadableSerializer&version=1.0.19

Meziantou.Framework.HumanReadableSerializer

One-way serializer to an invariant human-readable format. You can use HumanReadableSerializer.Serialize to convert an object to a string:

var obj = new { Name = "G�rald Barr�", Nickname = "meziantou", Age = 32, MultiLineString = "line1\nline2" };
var output = HumanReadableSerializer.Serialize(obj);

output contains the following value:

Name: G�rald Barr�
Nickname: meziantou
Age: 32
MultiLineString:
  line1
  line2

You can customize the serializer using an instance of HumanReadableSerializerOptions or by using attributes:

var options = new HumanReadableSerializerOptions()
{
    IncludeFields = true,
    DefaultIgnoreCondition = HumanReadableIgnoreCondition.WhenWritingNull,
};
HumanReadableSerializer.Serialize(obj, options);

Available attributes:

  • [HumanReadableIgnore] allows to ignore a property or a field
  • [HumanReadableIncludeAttribute] allows to include a property or a field
  • [HumanReadablePropertyNameAttribute] allows to set the name of a property or a field when serializing the value
  • [HumanReadablePropertyOrderAttribute] allows to order the properties when serializing an object
  • [HumanReadableConverterAttribute] allows to set the converter to use to serialize a property, a field, or a type

You can customize a type you don't own by using the following:

var options = new HumanReadableSerializerOptions();

// Add the HumanReadableIgnoreAttribute to the User.DisplayName property
options.AddAttribute(typeof(User), "DisplayName", new HumanReadableIgnoreAttribute());
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Meziantou.Framework.HumanReadableSerializer:

Package Downloads
Meziantou.Framework.InlineSnapshotTesting The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org.

Enables verification of objects using inline snapshots

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.19 18,732 12/29/2023
1.0.18 7,953 11/15/2023
1.0.17 295 9/29/2023
1.0.16 144 9/29/2023
1.0.15 440 7/18/2023
1.0.14 212 7/10/2023
1.0.13 446 5/31/2023
1.0.11 166 5/31/2023
1.0.10 198 5/30/2023
1.0.9 168 5/27/2023
1.0.8 259 5/25/2023
1.0.7 193 5/24/2023
1.0.5 386 4/21/2023
1.0.4 243 4/12/2023
1.0.3 258 4/1/2023
1.0.2 354 3/21/2023
1.0.1 272 3/19/2023
1.0.0 195 3/18/2023