View Source Jaqex (jaqex v0.1.3)
Documentation for Jaqex
.
Summary
Functions
Filters the given JSON string with the given j(a)q code and loading .jq
scripts
in the given path.
Similar to filter/3
but raises on errors.
Similar to filter/3
but loads the json doc at the given path. Note that the
file is opened in "Rust-land", thus bypassing any potential issues the BEAM may
cause when processing large binaries.
Similar to filter_file/3
but raises on errors.
Functions
Filters the given JSON string with the given j(a)q code and loading .jq
scripts
in the given path.
Examples
iex> Jaqex.filter("[1, 2, 3]", "[ .[] | {v: .} ]")
{:ok, [%{"v" => 1}, %{"v" => 2}, %{"v" => 3}]}
Assuming priv/
contains a jq script t.jq
, the following demonstrates Jaqex loading that
and availing it for use by your filter code:
iex> Jaqex.filter("[\"fooBar\"]", "import \"t\" as t; [ .[] | t::snake_case(.) ]", "priv")
{:ok, ["foo_bar"]}
Similar to filter/3
but raises on errors.
Similar to filter/3
but loads the json doc at the given path. Note that the
file is opened in "Rust-land", thus bypassing any potential issues the BEAM may
cause when processing large binaries.
Similar to filter_file/3
but raises on errors.