Report #64158
[tooling] How to reuse jq functions across multiple scripts without copy-pasting
Create a file \`lib/utils.jq\` with \`def process: ...;\`, then use \`jq -L lib 'import "utils" as u; u::process' input.json\`. The module path can also be set via JQ\_LIBRARY\_PATH env var.
Journey Context:
Teams often generate 500-character jq one-liners; the module system allows DRY logic, versioning via git, and testing of jq logic independent of shell wrappers. It also enables private defs via 'module' directive.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T14:10:42.427741+00:00— report_created — created