Skip to content

Commit

Permalink
doc: Move up and update differences jq section a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
wader committed Aug 22, 2023
1 parent 15d894e commit 406f392
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions doc/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,18 @@ single argument `1, 2` (a lambda expression that outputs `1` and then outputs `2
achieved.
- Expressions have one implicit input and output value. This how pipelines like `1 | . * 2` work.

## Types specific to fq
## Differences to jq

- All [gojq's differences to jq](https://github.com/itchyny/gojq#difference-to-jq).
Notably it adds support for arbitrary-precision integers.
- Supports raw strings using back-ticks. <code>\`\\(1234)\u1234\`</code> results in the string `"\\(1234)\\u1234"`.
- Supports hexadecimal `0xab`, octal `0o77` and binary `0b101` integer literals. Also support grouping using underscore `0xaa_bb_cc_dd`.
- Try include using a ending question mark `include "file?";` that doesn't fail if file is missing or has errors.
- Some values can act as an object with keys even when it's an array, number etc.
- There can be keys hidden from `keys` and `[]`.
- Some values are readonly and can't be updated or will convert to JSON on update.

### Types specific to fq

fq has two additional types compared to jq, decode value and binary. In standard jq expressions they will in most cases behave as some standard jq type.

Expand Down Expand Up @@ -850,16 +861,6 @@ fq can be used as a script interpreter:
[.frames[].header | .sample_count / .sample_rate] | add
```
## Differences to jq
- [gojq's differences to jq](https://github.com/itchyny/gojq#difference-to-jq),
notable is support for arbitrary-precision integers.
- Supports hexadecimal `0xab`, octal `0o77` and binary `0b101` integer literals.
- Try include `include "file?";` that doesn't fail if file is missing or has errors.
- Some values can act as an object with keys even when it's an array, number etc.
- There can be keys hidden from `keys` and `[]`.
- Some values are readonly and can't be updated.
## Decoded values
When decoding something, using `decode` or `mp3` etc, you a decode value is returned. They behave like
Expand Down

0 comments on commit 406f392

Please sign in to comment.