Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 

lq

command-line Lua table processor (similar to jq)

Usage example

return {
  field = {
    number = 1,
    string = "str",
  },
  advanced = {
    { a = 1, b = 2, },
    { a = 3, b = 4, c = 11, },
    { a = 5, b = 6, },
  },
}
# lq .field.number input.lua
1
# lq '.field | keys' input.lua
number
string
# lq '.field | values' input.lua
1
str
# lq '.field.[]' input.lua
1
str
# lq '.advanced.[] | filter(.a == 1) | .b?'
2
# lq '.advanced.[] | (if has("c") then [.b] else [1,2] end)'
{
  1,
  2
}
{
  4
}
{
  1,
  2
}

Install

Run luarocks install lq or check-out this repository and run luarocks make.

About

command-line Lua table processor (lq is for Lua what jq is for JSON)

Resources

License

Packages

No packages published

Languages