Nyxalon.Storage.Local 1.0.0-beta.148

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

Nyxalon.Storage

A lightweight, provider-based storage abstraction for .NET — clean API, minimal dependencies, wired via Microsoft.Extensions.DependencyInjection.

NuGet NuGet Downloads License: MIT


Overview

Nyxalon.Storage provides a simple, consistent abstraction over file storage. The built-in local provider backs the abstraction with the filesystem, making it easy to read and write files without coupling your application to a specific storage mechanism.

Swap out the provider later — swap in Azure Blob, S3, or an in-memory test double — without touching your application code.


Installation

dotnet add package Nyxalon.Storage

Getting Started

Register the local provider

builder.Services.AddNyxalonLocalStorage(options =>
{
    options.BasePath = "C:/MyApp/Storage"; // or a relative path
});

Inject and use

public class FileService(IStorageProvider storage)
{
    public async Task SaveAsync(string fileName, Stream content)
        => await storage.WriteAsync(fileName, content);

    public async Task<Stream> LoadAsync(string fileName)
        => await storage.ReadAsync(fileName);

    public async Task<bool> ExistsAsync(string fileName)
        => await storage.ExistsAsync(fileName);

    public async Task DeleteAsync(string fileName)
        => await storage.DeleteAsync(fileName);
}

API Reference

IStorageProvider

Method Description
WriteAsync(string path, Stream content) Write a stream to the given path
ReadAsync(string path) Read a file as a stream
ExistsAsync(string path) Check whether a file exists
DeleteAsync(string path) Delete a file
ListAsync(string? prefix) List files, optionally filtered by prefix

Configuration

AddNyxalonLocalStorage accepts a LocalStorageOptions object:

Property Type Default Description
BasePath string Current directory Root directory for all storage operations
CreateIfNotExists bool true Creates the base path directory if it does not exist

Testing

Substitute a test double for IStorageProvider in your unit tests — no filesystem required:

var mockStorage = Substitute.For<IStorageProvider>();

mockStorage
    .ReadAsync("report.pdf")
    .Returns(File.OpenRead("fixtures/report.pdf"));

Roadmap

  • Nyxalon.Storage.AzureBlob — Azure Blob Storage provider
  • Nyxalon.Storage.S3 — Amazon S3 provider
  • Nyxalon.Storage.InMemory — In-memory provider for testing

License

MIT © Nyxalon

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

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
1.0.0-beta.148 74 3/23/2026
1.0.0-beta.147 64 3/23/2026