Skip to content

Expand readme with usage examples and streaming JSONL section#11

Merged
kzu merged 3 commits intomainfrom
copilot/expand-readme-with-examples
Mar 8, 2026
Merged

Expand readme with usage examples and streaming JSONL section#11
kzu merged 3 commits intomainfrom
copilot/expand-readme-with-examples

Conversation

Copy link
Contributor

Copilot AI commented Mar 7, 2026

Adds practical usage examples and documents the async streaming API for JSONL processing.

New examples under Usage

  • Reshaping objects — object construction to project/flatten nested fields
  • Optional fields and defaults// alternative operator for absent/null fields
  • Array operationsgroup_by + map for collection aggregation

New Streaming JSONL section

Documents Jq.EvaluateAsync with IAsyncEnumerable<JsonElement> input:

using var stream = File.OpenRead("users.jsonl");
var elements = JsonSerializer.DeserializeAsyncEnumerable<JsonElement>(
    stream, topLevelValues: true);

await foreach (var result in Jq.EvaluateAsync("select(.dept == \"Engineering\") | .name", elements))
    Console.WriteLine(result);

Covers three patterns: one-shot stream filtering, reusing a pre-parsed JqExpression across multiple streams, and CancellationToken integration.

Note: JQSharp does not support the shorthand {field} object constructor syntax — all examples use explicit {key: expr} form.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: kzu <169707+kzu@users.noreply.github.com>
Copilot AI changed the title [WIP] Expand readme documentation with more usage examples docs: expand readme with usage examples and streaming JSONL section Mar 7, 2026
Copilot finished work on behalf of kzu March 7, 2026 22:55
@kzu kzu marked this pull request as ready for review March 8, 2026 00:20
@kzu kzu changed the title docs: expand readme with usage examples and streaming JSONL section Expand readme with usage examples and streaming JSONL section Mar 8, 2026
@kzu kzu added the docs label Mar 8, 2026
@kzu kzu enabled auto-merge (rebase) March 8, 2026 00:20
@kzu
Copy link
Member

kzu commented Mar 8, 2026

445 passed 445 passed

🧪 Details on Ubuntu 24.04.3 LTS

from retest v1.1.0 on .NET 10.0.3 with 💜 by @devlooped

@kzu kzu merged commit 50eb407 into main Mar 8, 2026
4 checks passed
@kzu kzu deleted the copilot/expand-readme-with-examples branch March 8, 2026 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants