Skip to content
/ lq Public

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

License

Notifications You must be signed in to change notification settings

devurandom/lq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Stars

Watchers

Forks

Packages

No packages published

Languages