NerdyMishka.Chalk 0.1.0

dotnet add package NerdyMishka.Chalk --version 0.1.0
NuGet\Install-Package NerdyMishka.Chalk -Version 0.1.0
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="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
#r "nuget: NerdyMishka.Chalk, 0.1.0"
#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 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

🖍 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 😃"));

alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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 was computed.  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 was computed.  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 net45 is compatible.  net451 was computed.  net452 was computed.  net46 was computed.  net461 is compatible.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  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.
  • .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 995 11/24/2018

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