Nyxalon.Storage.Local
1.0.0-beta.148
dotnet add package Nyxalon.Storage.Local --version 1.0.0-beta.148
NuGet\Install-Package Nyxalon.Storage.Local -Version 1.0.0-beta.148
<PackageReference Include="Nyxalon.Storage.Local" Version="1.0.0-beta.148" />
<PackageVersion Include="Nyxalon.Storage.Local" Version="1.0.0-beta.148" />
<PackageReference Include="Nyxalon.Storage.Local" />
paket add Nyxalon.Storage.Local --version 1.0.0-beta.148
#r "nuget: Nyxalon.Storage.Local, 1.0.0-beta.148"
#:package Nyxalon.Storage.Local@1.0.0-beta.148
#addin nuget:?package=Nyxalon.Storage.Local&version=1.0.0-beta.148&prerelease
#tool nuget:?package=Nyxalon.Storage.Local&version=1.0.0-beta.148&prerelease
Nyxalon.Storage
A lightweight, provider-based storage abstraction for .NET — clean API, minimal dependencies, wired via Microsoft.Extensions.DependencyInjection.
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 providerNyxalon.Storage.S3— Amazon S3 providerNyxalon.Storage.InMemory— In-memory provider for testing
License
MIT © Nyxalon
| 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
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 |