Juner.Sequence
1.0.0-preview-2
See the version list below for details.
dotnet add package Juner.Sequence --version 1.0.0-preview-2
NuGet\Install-Package Juner.Sequence -Version 1.0.0-preview-2
<PackageReference Include="Juner.Sequence" Version="1.0.0-preview-2" />
<PackageVersion Include="Juner.Sequence" Version="1.0.0-preview-2" />
<PackageReference Include="Juner.Sequence" />
paket add Juner.Sequence --version 1.0.0-preview-2
#r "nuget: Juner.Sequence, 1.0.0-preview-2"
#:package Juner.Sequence@1.0.0-preview-2
#addin nuget:?package=Juner.Sequence&version=1.0.0-preview-2&prerelease
#tool nuget:?package=Juner.Sequence&version=1.0.0-preview-2&prerelease
Juner.Sequence
A high-performance, AOT-friendly JSON sequence serializer for .NET.
Juner.Sequence provides streaming serialization and deserialization for sequence-based JSON formats such as:
- JSON Lines (
.jsonl) - JSON Text Sequences (RFC 7464, RS-delimited)
It is designed with System.IO.Pipelines and System.Text.Json in mind, focusing on:
- ๐ High performance (minimal allocations)
- ๐ AOT compatibility (no reflection by default)
- ๐ True streaming via
IAsyncEnumerable<T>
โจ Features
- Fully streaming (no full buffering required)
JsonTypeInfo<T>-based (AOT safe)- Supports JSON Lines and JSON Sequence formats
- Works directly with
PipeReader/PipeWriter - Optional extensions for:
- Encoding support
JsonSerializerOptionscompatibility
๐ฆ Installation
dotnet add package Juner.Sequence
๐ Quick Start
Serialize
await SequenceSerializer.SerializeAsync(
writer,
asyncEnumerable,
jsonTypeInfo,
SequenceSerializerOptions.JsonLines,
cancellationToken);
Deserialize
await foreach (var item in SequenceSerializer.DeserializeAsyncEnumerable(
reader,
jsonTypeInfo,
SequenceSerializerOptions.JsonLines,
cancellationToken))
{
Console.WriteLine(item);
}
๐ AOT-Friendly Design
This library is built around:
JsonTypeInfo<T>
instead of JsonSerializerOptions.
Why?
- No runtime reflection
- Works with Native AOT
- Better performance and predictability
โ ๏ธ Optional: JsonSerializerOptions Support
You can opt-in to JsonSerializerOptions support:
using Juner.Sequence.Extensions.Json;
Example:
await SequenceSerializer.SerializeAsync(
writer,
asyncEnumerable,
jsonSerializerOptions,
SequenceSerializerOptions.JsonLines);
โ ๏ธ These APIs are not AOT-safe and may use reflection.
๐ Encoding Support
By default, the library operates in UTF-8.
To use other encodings:
using Juner.Sequence.Extensions;
await SequenceSerializer.SerializeAsync(
writer,
asyncEnumerable,
jsonTypeInfo,
SequenceSerializerOptions.JsonLines,
Encoding.UTF8);
Internally, this uses a transcoding stream.
๐ Supported Formats
JSON Lines
{"id":1}
{"id":2}
JSON Text Sequence (RFC 7464)
RS {"id":1}
RS {"id":2}
๐งฑ Architecture
Juner.Sequence
โ Core (AOT-safe)
โ โ JsonTypeInfo<T> APIs
โ
โ Extensions
โ โ Encoding support
โ
โ Extensions.Json
โ JsonSerializerOptions support (โ not AOT-safe)
๐งช Example with PipeReader
var reader = PipeReader.Create(stream);
await foreach (var item in SequenceSerializer.DeserializeAsyncEnumerable(
reader,
jsonTypeInfo,
SequenceSerializerOptions.JsonLines))
{
// process item
}
๐ When to Use
Use this library when:
- Processing large JSON streams
- Building high-performance APIs
- Targeting Native AOT
- Working with pipelines or streaming systems
โ ๏ธ When NOT to Use
- Small payloads โ use
JsonSerializer - Reflection-heavy scenarios โ use
JsonSerializerOptionsdirectly
๐ License
MIT License
๐ Contributing
Contributions are welcome!
Feel free to open issues or pull requests.
๐ก Notes
- Prefer
JsonTypeInfo<T>for best performance and AOT safety - Use extensions only when necessary
- Keep streaming โ avoid buffering
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. 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.
-
net7.0
- System.IO.Pipelines (= 8.0.0)
-
net8.0
- System.IO.Pipelines (>= 8.0.0)
-
net9.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Juner.Sequence:
| Package | Downloads |
|---|---|
|
Juner.AspNetCore.Sequence
Streaming JSON support for ASP.NET Core (NDJSON, JSON Lines, JSON Sequence). Also supports JSON arrays as non-streaming input/output for convenience. Provides Minimal API and MVC integration with content negotiation and OpenAPI support. |
|
|
Juner.Http.Sequence
Streaming JSON sequence support for HttpClient and HttpContent. Send and receive NDJSON, JSON Lines, and JSON Sequence using IAsyncEnumerable<T>. Built on System.Text.Json and the Juner.Sequence core serializer. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 154 | 3/30/2026 |
| 1.0.0-preview-2 | 136 | 3/26/2026 |