FreakyKit.Utils 1.0.1

Prefix Reserved
dotnet add package FreakyKit.Utils --version 1.0.1
                    
NuGet\Install-Package FreakyKit.Utils -Version 1.0.1
                    
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="FreakyKit.Utils" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FreakyKit.Utils" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="FreakyKit.Utils" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FreakyKit.Utils --version 1.0.1
                    
#r "nuget: FreakyKit.Utils, 1.0.1"
                    
#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.
#:package FreakyKit.Utils@1.0.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FreakyKit.Utils&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=FreakyKit.Utils&version=1.0.1
                    
Install as a Cake Tool

FreakyKit.Utils

A robust and lightweight collection of C# extension methods designed to simplify common programming patterns and utility operations in .NET projects. This library includes extensions for arrays, collections, commands, dates, enumerables, exceptions, lists, numbers, objects, dependency injection, streams, strings, and tasks.

Features

  • Array Extensions: Multi-dimensional array traversal and element-wise actions.
  • Collection Extensions: Simplified range add/remove operations for any collection.
  • Command Extensions: Safe WPF ICommand pattern execution.
  • DateTime Extensions: Weekday/weekend checks and workday calculations.
  • Enumerable Extensions: Functional utilities like WithIndex, DistinctBy, safe list methods, shuffling, and more.
  • Exception Extensions: Deep exception tracing to system logs.
  • List Extensions: High-performance removal, insertion, and binary search.
  • Number Extensions: Generic range checks for all number types.
  • Object Extensions: Cloning, safe type conversions, JSON/XML utilities, and structural comparison.
  • ServiceProvider Extension: Strongly-typed DI service fetching.
  • Stream Extensions: Stream conversions and Base64 encoding/decoding.
  • String Extensions: Text manipulations, Base64, reverse, currency, and validation utilities.
  • Task Extensions: WhenAll with aggregate exceptions, safe result retrieval, and task timeout support.

Installation

Add the compiled DLL to your project, or copy the relevant extension files into your solution.

dotnet add package FreakyKit.Utils

Usage

Add a using directive to the FreakyKit.Utils namespace:

using FreakyKit.Utils;

// Array: Traverse a 2D array
matrix.ForEach((array, position) => Console.WriteLine(array.GetValue(position)));

// List: Remove items matching a predicate
myList.RemoveAll(x => x.IsObsolete);

// String: Validate email
bool isValid = "test@example.com".IsValidEmail();

// Enumerable: Enumerate with index
foreach (var (item, idx) in items.WithIndex()) { ... }

// Number: Check range
bool inRange = age.IsBetween(18, 65);

// DateTime: Find next workday
DateTime nextWorkday = today.NextWorkday();

// Task: Await with timeout
await task.TimeoutAfter(TimeSpan.FromSeconds(10));

For full API details, see the XML comments in each extension method.

Documentation

  • All extension classes are in the FreakyKit.Utils namespace.
  • Methods use strong typing, safe defaults, and minimal dependencies.
  • Most methods contain XML documentation accessible via IntelliSense.

I am also planning to either add the documentation here or to the wiki soon.

Contributing

Contributions are welcome! Please submit issues and PRs for bug reports, new utilities, or improvements. All code must follow C# standard naming conventions and include XML documentation.

License

This project is released under the MIT License.

Product 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.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on FreakyKit.Utils:

Package Downloads
Plugin.Maui.Biometric

A Biometric plug-in for .NET MAUI

FreakyEffects

FreakyEffects is a effects kit for .NET MAUI which provides a set of effects and utilities to build modern mobile apps.

FreakyControls

Maui.FreakyControls is a free OSS UI Kit for .NET MAUI which provides a set of controls and utilities to build modern mobile apps.

FreakyUXKit

FreakyUXKit is a modern UX library for .NET MAUI. It helps developers create intuitive tutorials, tooltips, and walkthroughs with ease.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.1 147 9/18/2025
1.0.0 78 9/17/2025

A utility project with extensions and other helper methods