libjq.cr
libjq.cr
Crystal bindings for libjq.
- crystal:
0.33.0
..1.2.2
WARNING: This project is in alpha stage. Currently, this should only be used for short-term applications due to memory leaks.
Installation
- Add the dependency to your
shard.yml
:
dependencies:
libjq:
github: maiha/libjq
version: 0.2.0
- Run
shards install
Make sure that libjq.{a,so}
is on your system. For example, on ubuntu, you can install it with apt install libjq-dev
.
Usage
require "libjq"
filter = ".foo"
input = %({"foo": 42, "bar": 43})
Libjq::Jq.run(filter, input).to_s # => 42
filter = %(with_entries(.key |= "KEY_" + .))
input = %({"a": 1, "b": 2})
Libjq::Jq.run(filter, input).to_s # => {"KEY_a":1,"KEY_b":2}
See examples/jq.cr
Development
$ make test
Contributing
- Fork it (https://github.com/maiha/libjq.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- maiha - creator and maintainer
Repository
libjq.cr
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- about 2 years ago
- May 2, 2022
License
MIT License
Links
Synced at
Fri, 17 May 2024 20:59:21 GMT
Languages