ファイルベース実行例2.
File-based Apps で、NuGet パッケージの外部ライブラリを使用する
Section titled “ファイルベース実行例2. File-based Apps で、NuGet パッケージの外部ライブラリを使用する”File-based Apps で、たとえば NuGet パッケージの外部ライブラリを追加して参照するには、#:package ディレクティブを使用します。
今回ここでは、Cygames グループ会社の Cysharp 製「Kokuban」ライブラリを使用してみます。
GitHub - Cysharp/Kokuban: Simplifies styling strings in the terminal for .NET application.
Simplifies styling strings in the terminal for .NET application. - Cysharp/Kokuban
https://github.com/Cysharp/Kokuban
ソースコード
Section titled “ ソースコード”Hogera.cs
Section titled “ Hogera.cs”#!/usr/bin/env dotnet#:package Kokuban@0.2.0using Kokuban;Console.WriteLine(Chalk.Bold.Red.BgYellow["Hello, World!"]);使用ライブラリの、ライセンス表記
Kokuban
MIT License
Copyright (c) Cysharp, Inc.Copyright (c) Mayuki Sawatari mayuki@misuzilla.org
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.
Part of the source code of this library is derived from the following libraries.The original source codes are licensed under the MIT License.
chalk/supports-colorCopyright (c) Sindre Sorhus sindresorhus@gmail.com (https://sindresorhus.com)
chalk/ansi-stylesCopyright (c) Sindre Sorhus sindresorhus@gmail.com (https://sindresorhus.com)
Qix-/color-convertCopyright c 2011-2016, Heather Arthur. Copyright c 2016-2021, Josh Junon.