Coder Social home page Coder Social logo

dumpify's Introduction

Dumpify

This library is under development and is not recommended in Production payloads

Improve productivity and debuggability by adding .Dump() extension methods to Console Applications, similar to LinqPad's.

One of my favorites LinqPad feature is its .Dump() extension methods and how customizable they are. It was always hard to return to Visual Studio or any Console Application and find out this feature doesn't exist there.

Features

  • Dump any object to Console
  • Support for Arrays and IEnumerables
  • Support for Custom descriptors
  • Support for max nesting levels
  • Support for circular dependencies and references
  • Support for styling and customizations
  • Configurable
  • Spectre.Console renderers
  • Special Handling for types:
    • Arrays, IEnumerables, Collections.
    • StringBuilder
    • System.Reflection types

How to Install

Either run dotnet add package Dumpify or Install-Package Dumpify

Examples:

new { Name = "Dumpify", Description = "Dump any object to Console" }.Dump();

image

Support nesting as well

var moaid = new Person { FirstName = "Moaid", LastName = "Hathot" };
var haneeni = new Person { FirstName = "Haneeni", LastName = "Shibli" };

moaid.Spouse = haneeni;
haneeni.Spouse = moaid;

moaid.Dump();

image

Support for special types like arrays and Dictionaries

var arr = new[] { 1, 2, 3, 4 }.Dump();

image

var arr2d = new int[,] { {1, 2}, {3, 4} }.Dump();

image

new Dictionary<string, string>
{
   ["Moaid"] = "Hathot",
   ["Haneeni"] = "Shibli",
   ["Eren"] = "Yeager",
   ["Mikasa"] = "Ackerman",
}.Dump();

image

Features for the future 0.5.0 release

  • Simple text renderer
  • Consider disabling wrapping of Table titles
  • re-introduce labels
  • Consier adding "" to string values.

Features for the future 0.6.0 release

  • Better styling of Custom values
    • Typeof(T) for example, Generic types, etc.
  • Better rendering of Delegates

To do

  • Custom Outputs
  • Live outputs
  • Improve Cache By decoupling the PropertyInfo from the Descriptors.
  • Rethink Generators caching keys
  • Consider using Max Depth for Descriptors
  • Refactor Renderers and make it better extendable
  • Add more renderers
    • re-introduce Json Renderers
    • JavaScript's console.log style
    • CSharp Renderer
  • Decouple from Spectre.Console
  • Tests
    • More tests
    • Visual (Render) Tests - consider acceptance tests
    • Tests for Nesting
  • Add support for include fields
  • Add support for include private members
  • Cache Spectre.Console styles and colors
  • More sync between Custom Descriptors and Custom Renderers
    • Think how we can mark type's descriptor as needing special rendering.
    • The current CustomDescriptorGenerator must generate a value
    • Consider ValueTuple
  • Refactor SpectureTableRenderer to share customization code
  • Consider changing the style/view of ObjectDescriptors without properties (currently empty table)

Disclaimer

This project is inspired by LinqPad's Dump features, authored by Joseph Albahari.

dumpify's People

Contributors

moaidhathot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.