# `Jaqex`
[🔗](https://github.com/shaolang/jaqex/blob/v0.1.5/lib/jaqex.ex#L1)

Documentation for `Jaqex`.

# `filter`

```elixir
@spec filter(String.t(), String.t(), Path.t()) :: {:ok, term()} | {:error, term()}
```

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"]}
```

# `filter!`

```elixir
@spec filter!(String.t(), String.t(), Path.t()) :: term()
```

Similar to `filter/3` but raises on errors.

# `filter_file`

```elixir
@spec filter_file(Path.t(), String.t(), Path.t()) :: {:ok, term()} | {:error, term()}
```

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.

# `filter_file!`

```elixir
@spec filter_file!(Path.t(), String.t(), Path.t()) :: term()
```

Similar to `filter_file/3` but raises on errors.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
