Hyprx.Core 0.0.0-alpha.3

This is a prerelease version of Hyprx.Core.
dotnet add package Hyprx.Core --version 0.0.0-alpha.3
                    
NuGet\Install-Package Hyprx.Core -Version 0.0.0-alpha.3
                    
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="Hyprx.Core" Version="0.0.0-alpha.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Hyprx.Core" Version="0.0.0-alpha.3" />
                    
Directory.Packages.props
<PackageReference Include="Hyprx.Core" />
                    
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 Hyprx.Core --version 0.0.0-alpha.3
                    
#r "nuget: Hyprx.Core, 0.0.0-alpha.3"
                    
#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 Hyprx.Core@0.0.0-alpha.3
                    
#: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=Hyprx.Core&version=0.0.0-alpha.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Hyprx.Core&version=0.0.0-alpha.3&prerelease
                    
Install as a Cake Tool

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.