Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define jq libs as strings #8

Open
diafour opened this issue Jan 29, 2020 · 0 comments
Open

Define jq libs as strings #8

diafour opened this issue Jan 29, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@diafour
Copy link
Contributor

diafour commented Jan 29, 2020

jq can find all *.jq files in the directory specified by WithLibPath and then methods from these libraries can be used in the program. It will be useful if such libraries can be defined from strings.

libText := `
def camel:
  gsub("-(?<a>[a-z])"; .a|ascii_upcase);
`
Jq().WithLibrary("methods", libText).Program(`include "methods"; .foo | camel`).Run()
@diafour diafour added the enhancement New feature or request label Jan 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant