VOOZH about

URL: https://www.nuget.org/packages/Devlooped.JQ/

⇱ NuGet Gallery | Devlooped.JQ 1.8.1.1




👁 Image
Devlooped.JQ 1.8.1.1

Prefix Reserved
dotnet add package Devlooped.JQ --version 1.8.1.1
 
 
NuGet\Install-Package Devlooped.JQ -Version 1.8.1.1
 
 
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="Devlooped.JQ" Version="1.8.1.1" />
 
 
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Devlooped.JQ" Version="1.8.1.1" />
 
Directory.Packages.props
<PackageReference Include="Devlooped.JQ" />
 
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 Devlooped.JQ --version 1.8.1.1
 
 
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Devlooped.JQ, 1.8.1.1"
 
 
#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 Devlooped.JQ@1.8.1.1
 
 
#: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=Devlooped.JQ&version=1.8.1.1
 
Install as a Cake Addin
#tool nuget:?package=Devlooped.JQ&version=1.8.1.1
 
Install as a Cake Tool
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Packs the jq binaries for easy execution from dotnet applications running on Linux (AMD64 and ARM64), macOS (AMD64 and ARM64) and Windows (AMD64 and i386).

When JsonPath falls short, jq is the obvious next step in flexibility and power for JSON manipulation.

jq is like sed for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that sed, awk, grep and friends let you play with text.

Learn more about jq at https://jqlang.github.io/jq/.

Usage

Simple usage for extracting values:

var name = await JQ.ExecuteAsync(
 """
 {
 "name": "John",
 "age": 30
 }
 """,
 ".name");

Advanced Usage

For advanced scenarios, use JqParams to access all jq command-line options and JqResult to inspect exit codes and error output:

var result = await JQ.ExecuteAsync(new JqParams("{name: .name, extra: $myvar}")
{
 Json = """
 {
 "name": "John",
 "age": 30
 }
 """,
 Args = new Dictionary<string, string> { { "myvar", "value" } },
 CompactOutput = true,
 SortKeys = true
});

if (result.ExitCode == 0)
 Console.WriteLine(result.StandardOutput);
else
 Console.Error.WriteLine(result.StandardError);

The JqResult class provides:

  • ExitCode - the process exit code
  • StandardOutput - the standard output from jq
  • StandardError - the standard error from jq
  • Implicit conversion to string (returns StandardOutput)

The JqParams class supports:

  • Output options: RawOutput, CompactOutput, MonochromeOutput, ColorOutput, AsciiOutput, SortKeys, JoinOutput, Tab, Indent
  • Processing options: Slurp, NullInput, ExitStatus
  • Variable passing: Args (--arg), ArgsJson (--argjson), SlurpFiles (--slurpfile), RawFiles (--rawfile)

The JQ.Path static property provides the full path to the jq binary that's appropriate for the current OS and architecture so you can execute it directly if needed.

Examples

The following is a real-world scenario where WhatsApp Cloud API messages are converted into clean polymorphic JSON for nice OO deserialization via System.Text.Json.

Rather than navigating deep into the JSON structure, we can use jq to transform the payload into what we expect for deserialization of a text message:

{
 "id": "wamid.HBgNMTIwM==",
 "timestamp": 1678902345,
 "to": {
 "id": "792401583610927",
 "number": "12025550123"
 },
 "from": {
 "name": "Mlx",
 "number": "12029874563"
 },
 "content": {
 "$type": "text",
 "text": "😊"
 }
}

The original JSON looks like the following:

{
 "object": "whatsapp_business_account",
 "entry": [
 {
 "id": "813920475102346",
 "changes": [
 {
 "value": {
 "messaging_product": "whatsapp",
 "metadata": {
 "display_phone_number": "12025550123",
 "phone_number_id": "792401583610927"
 },
 "contacts": [
 {
 "profile": { "name": "Mlx" },
 "wa_id": "12029874563"
 }
 ],
 "messages": [
 {
 "from": "12029874563",
 "id": "wamid.HBgNMTIwM==",
 "timestamp": "1678902345",
 "text": { "body": "\ud83d\ude0a" },
 "type": "text"
 }
 ]
 },
 "field": "messages"
 }
 ]
 }
 ]
}

The following JQ query turns the latter info the former:

.entry[].changes[].value.metadata as $phone |
.entry[].changes[].value.contacts[] as $user |
.entry[].changes[].value.messages[] | 
{
 id: .id,
 timestamp: .timestamp | tonumber,
 to: {
 id: $phone.phone_number_id,
 number: $phone.display_phone_number
 },
 from: {
 name: $user.profile.name,
 number: $user.wa_id
 },
 content: {
 "$type": "text",
 text: .text.body
 }
}

This allows you to focus your C# code into the actual object model you want to work with, rather than the one imposed by the JSON format of external APIs.

See this code in action at Devlooped.WhatsApp.

Sponsors

👁 Clarius Org
👁 MFB Technologies, Inc.
👁 SandRock
👁 DRIVE.NET, Inc.
👁 Keith Pickford
👁 Thomas Bolon
👁 Kori Francis
👁 Uno Platform
👁 Reuben Swartz
👁 Jacob Foshee
👁 alternate text is missing from this package README image
👁 Eric Johnson
👁 David JENNI
👁 Jonathan
👁 Ken Bonny
👁 Simon Cropp
👁 agileworks-eu
👁 Zheyu Shen
👁 Vezel
👁 ChilliCream
👁 4OTC
👁 Vincent Limo
👁 domischell
👁 Adrian Alonso
👁 Michael Hagedorn
👁 torutek
👁 mccaffers
👁 rigu1
👁 Seika Logiciel

👁 Sponsor this project

Learn more about GitHub Sponsors

Product Versions Compatible and additional computed target framework versions.
.NET net5.0 net5.0 was computed.  net5.0-windows net5.0-windows was computed.  net6.0 net6.0 is compatible.  net6.0-android net6.0-android was computed.  net6.0-ios net6.0-ios was computed.  net6.0-maccatalyst net6.0-maccatalyst was computed.  net6.0-macos net6.0-macos was computed.  net6.0-tvos net6.0-tvos was computed.  net6.0-windows net6.0-windows was computed.  net7.0 net7.0 was computed.  net7.0-android net7.0-android was computed.  net7.0-ios net7.0-ios was computed.  net7.0-maccatalyst net7.0-maccatalyst was computed.  net7.0-macos net7.0-macos was computed.  net7.0-tvos net7.0-tvos was computed.  net7.0-windows net7.0-windows was computed.  net8.0 net8.0 is compatible.  net8.0-android net8.0-android was computed.  net8.0-browser net8.0-browser was computed.  net8.0-ios net8.0-ios was computed.  net8.0-maccatalyst net8.0-maccatalyst was computed.  net8.0-macos net8.0-macos was computed.  net8.0-tvos net8.0-tvos was computed.  net8.0-windows net8.0-windows was computed.  net9.0 net9.0 was computed.  net9.0-android net9.0-android was computed.  net9.0-browser net9.0-browser was computed.  net9.0-ios net9.0-ios was computed.  net9.0-maccatalyst net9.0-maccatalyst was computed.  net9.0-macos net9.0-macos was computed.  net9.0-tvos net9.0-tvos was computed.  net9.0-windows net9.0-windows was computed.  net10.0 net10.0 was computed.  net10.0-android net10.0-android was computed.  net10.0-browser net10.0-browser was computed.  net10.0-ios net10.0-ios was computed.  net10.0-maccatalyst net10.0-maccatalyst was computed.  net10.0-macos net10.0-macos was computed.  net10.0-tvos net10.0-tvos was computed.  net10.0-windows net10.0-windows was computed. 
.NET Core netcoreapp2.0 netcoreapp2.0 was computed.  netcoreapp2.1 netcoreapp2.1 was computed.  netcoreapp2.2 netcoreapp2.2 was computed.  netcoreapp3.0 netcoreapp3.0 was computed.  netcoreapp3.1 netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 netstandard2.0 is compatible.  netstandard2.1 netstandard2.1 was computed. 
.NET Framework net461 net461 was computed.  net462 net462 was computed.  net463 net463 was computed.  net47 net47 was computed.  net471 net471 was computed.  net472 net472 was computed.  net48 net48 was computed.  net481 net481 was computed. 
MonoAndroid monoandroid monoandroid was computed. 
MonoMac monomac monomac was computed. 
MonoTouch monotouch monotouch was computed. 
Tizen tizen40 tizen40 was computed.  tizen60 tizen60 was computed. 
Xamarin.iOS xamarinios xamarinios was computed. 
Xamarin.Mac xamarinmac xamarinmac was computed. 
Xamarin.TVOS xamarintvos xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Devlooped.JQ:

Package Downloads
Devlooped.Sponsors.Commands

Commands used by the dotnet-sponsor CLI to manage sponsorship manifests.

DevToys.JsonQuery

A jq runner extension for DevToys to run queries on json structures

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.8.1.1 143,618 2/16/2026
1.8.1 100,155 8/21/2025
1.8.1-beta 508 8/21/2025
1.7.1.8 296,049 4/9/2025
1.7.1.7 909 4/7/2025
1.7.1.6 668 4/7/2025
1.7.1.5 390 4/2/2025
1.7.1.4 307 4/2/2025
1.7.1.3 29,521 3/10/2025
1.7.1.2 196,855 8/17/2024
1.7.1.1 103,299 3/20/2024
1.7.0 699 3/20/2024