NerdyMishka.Chalk 0.1.0

.NET Standard 2.0 .NET Framework 4.5
Install-Package NerdyMishka.Chalk -Version 0.1.0
dotnet add package NerdyMishka.Chalk --version 0.1.0
<PackageReference Include="NerdyMishka.Chalk" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NerdyMishka.Chalk --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: NerdyMishka.Chalk, 0.1.0"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install NerdyMishka.Chalk as a Cake Addin
#addin nuget:?package=NerdyMishka.Chalk&version=0.1.0

// Install NerdyMishka.Chalk as a Cake Tool
#tool nuget:?package=NerdyMishka.Chalk&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

🖍 NerdyMishka.Chalk 🖍

Console/Terminal string styling for .NET console applications based on the amazing chalk library and it's dependencies in node.

Overview

I looked for a .NET library that similar to chalk while writing Kryptos, a command line to for encrypting/decrypting files. I did not find one. What I did find was exciting news around the Windows Console.

Microsoft has a team that is working hard on transforming the Windows Console after decades of gathering dust.

Windows 10 1511 and above enabled true color for the Windows console. This library will enable virtual terminal for Stand Output streams on Window 10. The virtual termainl is enabled in static constructor for Chalk. Chalk uses ANSI codes to style terminal strings.

The chalk library for node relies on libuv to handle true color support for windows.

Console/Terminal emulators often support 256 colors, but not true color, this include ConEmu. This library will attempt to find the closet color that the terminal supports.

Samples

ChalkConsole.WriteLine("test test", Color.Red);

Console.WriteLine(Chalk.Red().Draw("This is a test"));
Console.WriteLine(Chalk.BrightRed().Draw("This is a test"));
Console.WriteLine(Chalk.Color("Orange")
    .Draw("orange you glad Microsoft is updating the console?"));

Console.WriteLine(Chalk.Rgb(255, 0, 0).Draw("Rgb accepted"));
Console.WriteLine(Chalk.BgRed().White().Draw("This is a test"));
Console.WriteLine(Chalk.Magenta().Draw("This is a test w/o bold"));
Console.WriteLine(Chalk.Magenta().Bold().Draw("This is a test"));
Console.WriteLine(Chalk.BrightYellow().Draw("This is a test w bright"));
Console.WriteLine(Chalk.Yellow().Draw("This is a test w/o bright"));
Console.WriteLine(Chalk.Yellow().Dim().Draw("This is a test w  dim"));
Console.WriteLine(
    Chalk.Color("Purple", true)
    .Bold()
    .White()
    .Underline()
    .Draw(" > Woah! "));
Console.WriteLine("Back to being a normie");
Console.WriteLine(Chalk.Grey("chill"));
Console.WriteLine(Chalk.Black("chill"));

// emojis still do not work in the window's console
Console.WriteLine(Chalk.StrikeOut().Draw("3 strikes 😃"));

Release Notes

  • 0.1.0: Gather early feedback on the API and use across multiple platforms.

License

Copyright 2018 Nerdy Mishka

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Product Versions
.NET net5.0 net5.0-windows net6.0 net6.0-android net6.0-ios net6.0-maccatalyst net6.0-macos net6.0-tvos net6.0-windows
.NET Core netcoreapp2.0 netcoreapp2.1 netcoreapp2.2 netcoreapp3.0 netcoreapp3.1
.NET Standard netstandard2.0 netstandard2.1
.NET Framework net45 net451 net452 net46 net461 net462 net463 net47 net471 net472 net48
MonoAndroid monoandroid
MonoMac monomac
MonoTouch monotouch
Tizen tizen40 tizen60
Xamarin.iOS xamarinios
Xamarin.Mac xamarinmac
Xamarin.TVOS xamarintvos
Xamarin.WatchOS xamarinwatchos
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 4.5

    • No dependencies.
  • .NETFramework 4.6.1

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 795 11/24/2018

- **0.1.0**: Gather early feedback on the API and use across multiple
 platforms.