PupaLib.Node
0.0.3
dotnet add package PupaLib.Node --version 0.0.3
NuGet\Install-Package PupaLib.Node -Version 0.0.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="PupaLib.Node" Version="0.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="PupaLib.Node" Version="0.0.3" />
<PackageReference Include="PupaLib.Node" />
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 PupaLib.Node --version 0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: PupaLib.Node, 0.0.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 PupaLib.Node@0.0.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=PupaLib.Node&version=0.0.3
#tool nuget:?package=PupaLib.Node&version=0.0.3
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
<div align="center">
๐งฉ PupaLib.Node
PupaLib.Node is a lightweight node-based execution system for building modular data flows and logic graphs. ๐ฏ
<img src="https://github.com/Artpupser/PupaLib.Node/blob/main/assets/banner.jpg" style="border-radius: 20px; max-height: 500px">
</div>
๐ Navigation
โจ๏ธ Features
<div align="center">
| ๐ Feature | ๐ Description |
|---|---|
| Node-based Architecture | Build logic using connected nodes and blocks |
| Typed Data Flow | Strongly-typed connections via SimpleNode<T> |
| Reflection-driven Setup | Auto-detect inputs/outputs via attributes |
| Flexible Blocks | Supports Data, Action, and Static blocks |
| Connection System | Connect nodes by id or reference |
| Lazy Execution | Values are computed on demand (GetValue() triggers execution) |
| Bundle System | Group blocks into NodeBundle for easier lifecycle management |
| Builder Pattern | Fluent API for chaining (OnData, OnConnect, OnImpulse) |
</div>
๐ Installation
You can install the package via NuGet:
dotnet add package PupaLib.Node
or
Install-Package PupaLib.Node
๐งต Usage
๐ Define a custom block
public class AddBlock : NodeDataBlock<int>
{
[NodeInput("a")] public SimpleNode<int> A { get; set; } = new(null!);
[NodeInput("b")] public SimpleNode<int> B { get; set; } = new(null!);
[NodeOutput("result")] public SimpleNode<int> Result { get; set; } = new(null!);
public override void Impulse()
{
ThrowIfValueNull();
var result = A.GetValue() + B.GetValue();
Result.SetValue(result);
}
}
๐ Create and connect nodes
var bundle = new NodeBundle();
var add = bundle.AddBlock(new AddBlock());
var inputA = bundle.AddBlock(new SomeInputBlock(5));
var inputB = bundle.AddBlock(new SomeInputBlock(10));
bundle.Init();
// Connect inputs to add block
inputA.OnConnect<int>(add.A, "result");
inputB.OnConnect<int>(add.B, "result");
// Execute
add.Impulse();
var result = add.Result.GetValue();
Console.WriteLine(result); // 15
๐ Using builder pattern
add
.OnData(0)
.OnConnect<int>(add.A, "a")
.OnConnect<int>(add.B, "b");
๐ Working with NodeBundle
bundle.Init(); // Initialize all blocks
bundle.Reset(); // Reset all outputs
๐ Lazy execution
var value = add.Result.GetValue(); // triggers Impulse automatically if needed
๐ฆ Dependencies
None
๐๏ธ Devlog
0.0.3
- Initial implementation of node system
- Added
NodeDataBlock,NodeActionBlock,NodeStaticBlock - Reflection-based input/output binding
- Introduced
SimpleNode<T>for value propagation - Added
NodeBundlefor grouping and lifecycle control
โ๏ธ License
This project is licensed under the MIT License.
| 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.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.