j9

Crates.ioj9
lib.rsj9
version0.1.3
sourcesrc
created_at2024-03-04 11:16:45.652703
updated_at2024-03-23 08:18:25.773555
descriptionRust interface for jq-based JSON processing
homepage
repositoryhttps://github.com/ynqa/j9
max_upload_size
id1161615
size17,634
(ynqa)

documentation

README

j9

j9 provides a high-level API to run jq programs from Rust code, simplifying the execution of jq filters on JSON data.

Usage

To use j9, add it as a dependency in your Cargo.toml:

[dependencies]
j9 = "0.1.3"

Example

use j9;

fn main() -> anyhow::Result<()> {
    let json_str = r#"{ "number": 1 }"#;
    let jq = j9::run(".", json_str)?;
    println!("{:?}", jq);
    Ok(())
}

This example runs the simplest jq program (.) which outputs the input JSON unchanged. For more complex jq programs, simply replace "." with your jq filter.

Commit count: 17

cargo fmt