https://github.com/olorin37/sane-jq
JQ prelude / standard library with more sane behaviour.
https://github.com/olorin37/sane-jq
command-line-tool jq json
Last synced: over 1 year ago
JSON representation
JQ prelude / standard library with more sane behaviour.
- Host: GitHub
- URL: https://github.com/olorin37/sane-jq
- Owner: olorin37
- License: mit
- Created: 2020-02-20T21:43:36.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-11-15T08:59:36.000Z (over 2 years ago)
- Last Synced: 2025-02-05T08:48:40.996Z (over 1 year ago)
- Topics: command-line-tool, jq, json
- Language: jq
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Sane jq prelude library
JQ prelude library. It implements only functions for which their buildin alternative behaves badly.
# Usage
Just put `prelude.jq` file in `~/.jq` at your users home (the user which runs `jq`). And in your
`jq` code just include or import the file.
```
import "prelude" as Prelude;
Prelude::lt(7, 10) # => true
Prelude::gt("7", 7) # => yields error (while standard jq "7" > 7 would return true, sic!)
# or just
include "prelude";
lt(7, 10) # => true
gt("a", "b") # => false
```
# Reason
`jq` is a wonderful tool for JSON manipulation from Shell scripts, but some of standard functions
or operators behave in a little irrational way.
_to be continued_