Hyprx.Core
0.0.0-alpha.3
dotnet add package Hyprx.Core --version 0.0.0-alpha.3
NuGet\Install-Package Hyprx.Core -Version 0.0.0-alpha.3
<PackageReference Include="Hyprx.Core" Version="0.0.0-alpha.3" />
<PackageVersion Include="Hyprx.Core" Version="0.0.0-alpha.3" />
<PackageReference Include="Hyprx.Core" />
paket add Hyprx.Core --version 0.0.0-alpha.3
#r "nuget: Hyprx.Core, 0.0.0-alpha.3"
#:package Hyprx.Core@0.0.0-alpha.3
#addin nuget:?package=Hyprx.Core&version=0.0.0-alpha.3&prerelease
#tool nuget:?package=Hyprx.Core&version=0.0.0-alpha.3&prerelease
Hyprx.Core
Overview
Hyprx Core extends the the .NET Base Class Library with key functionality such as:
- Result type
- Extension methods and members under the Extras namespaces for strings, spans, string builder, arrays, tasks, etc.
- The static FileSystem class which provides an fs module similar to other std libraries including functions missing posix functions like copy, chown, chmod, stat, etc.
- Enhanced logic for working with environments such as expanding bash style variables, appending/prepending paths to the environment path, etc
Usage
FileSystem examples
using static Hyprx.IO.FileSystem;
if (Environment.IsPrivilegedProcess)
{
Chown("/home/user/file", "root", "root");
}
// copies recursively
CopyDir("/home/user/.local/bin", "/home/user/tmp/bin", true);
Result example
using Hyprx.Results;
using static Hyprx.Results.Result;
var strRes = Ok("10");
Console.WriteLine(strRes.IsOk);
Console.WriteLine(strRes.IsError);
Console.WriteLine(strRes.Value);
Console.WriteLine(strRes.Map(o => int.Parse(o)));
var bad = Fail<string>(new InvalidOperationException("Failed to get value"));
Console.WriteLine(strRes.IsOk);
Console.WriteLine(strRes.IsError);
Console.WriteLine(strRes.Error.Message);
var value = strRes.OrDefault("fallback string");
Console.WriteLine(value);
var res = TryCatch(() => {
Hyprx.IO.FileSystem.Chown("/opt/app", "user", "user");
});
Console.WriteLine(strRes.IsOk);
Console.WriteLine(strRes.IsError);
Env Example
using Hyprx;
Console.WriteLine(Env.Expand("home is '${HOME}' on linux or '${USERPROFILE}' on windows."));
if (!Env.HasPath("C:\\Program Files\\Git\\usr\\bin"))
Env.PrependPath("C:\\Program Files\\Git\\usr\\bin");
Env.Set(new Dictionary<string, string>{
["VALUE_ONE"] = "one",
["VALUE_TWO"] = "two"
});
Env.Vars["VALUE_THREE"] = "three"
Console.WriteLine(Env.Get("VALUE_ONE"));
Console.WriteLine(Env.Vars("VALUE_ONE"));
Console.WriteLine(Env.Vars.Home);
Console.WriteLine(Env.Vars.User);
Env.Unset("VALUE_TWO");
var result = Env.TryGet("VALUE_TWO");
var value = result.OrDefault("fallback value")l
Console.WriteLine(value);
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net10.0 is compatible. 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. |
-
net10.0
- No dependencies.
NuGet packages (4)
Showing the top 4 NuGet packages that depend on Hyprx.Core:
Package | Downloads |
---|---|
Hyprx.Rex.Core
Rex primitives for defining tasks, jobs, and deployments. |
|
Hyprx.Rex.Pipelines
Hyprx.Rex.Pipelines provides the core pipelines that execute rex tasks, jobs, and deployments. |
|
Hyprx.Shell
Shell makes it easier to use functionality in .NET single file apps similar to what you would find in a shell script such as common posix file system utilities, echo, print, running commands, and more. |
|
Hyprx.Exec
A library for executing processes, spawning child processes, and running commands. It provides a simple API for process management and execution. It supports synchronous and asynchronous execution, capturing output, and handling errors. |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last Updated |
---|---|---|
0.0.0-alpha.3 | 120 | 7/10/2025 |
0.0.0-alpha.2 | 105 | 7/10/2025 |
0.0.0-alpha.1 | 117 | 6/25/2025 |
0.0.0-alpha.0 | 120 | 6/17/2025 |
# Hyprx.Core Changelog
## 0.0.0-alpha.0
Initial feature set:
- Result type
- Extension methods and members under the Extras namespaces for strings,
spans, string builder, arrays, tasks, etc.
- The static FileSystem class which provides an fs module similar
to other std libraries including functions missing posix functions
like copy, chown, chmod, stat, etc.
- Enhanced logic for working with environments such as expanding
bash style variables, appending/prepending paths to the environment
path, etc.
## 0.0.0-alpha.1
- Add commonly used Generic types that inherit from Dictionary, List, and Dictionary.
- `Map<TKey, TValue>`, `Map<TValue>`, and `Map` which is `Dictionary<string, object?>`
- Add overloads for key,value tuples to enable `new Map([(key1, value1), (key2, value2)]);`
- Add StringList which is a common list type along with a ContainsFold and IndexOfFolder methods.
- Add OrderedMaps.