🛠️ [JQ::Lite] A pure-Perl jq-like JSON query engine – no XS, no external binary
I've built a pure-Perl module inspired by the awesome jq
command-line tool.
👉 JQ::Lite on MetaCPAN
👉 GitHub repo
🔧 Features
-
Pure Perl — no XS, no C, no external
jq
binary -
Dot notation:
.users[].name
-
Optional key access:
.nickname?
-
Filters with
select(...)
:==
,!=
,<
,>
,and
,or
-
Built-in functions:
length
,keys
,sort
,reverse
,first
,last
,has
,unique
-
Array indexing & expansion
-
Command-line tool:
jq-lite
(reads from stdin or file) -
Interactive mode: explore JSON line-by-line in terminal
🐪 Example (in Perl)
use JQ::Lite; my $json = '{"users":[{"name":"Alice"},{"name":"Bob"}]}'; my $jq = JQ::Lite->new; my u/names = $jq->run_query($json, '.users[].name'); print join("\n", @names), "\n";
🖥️ Command-line (UNIX/Windows)
cat users.json | jq-lite '.users[].name' jq-lite '.users[] | select(.age > 25)' users.json type users.json | jq-lite ".users[].name"
Interactive mode:
jq-lite users.json
I made this for those times when you need jq-style JSON parsing inside a Perl script, or want a lightweight jq-alternative in environments where installing external binaries isn't ideal.
Any feedback, bug reports, or stars ⭐ on GitHub are very welcome!
Cheers!