141231.1 · ae7f8d6ab9d29bd72f462fdafa4d7a9270706d3b
Further module system revamp (fix #659)
To import a module now use:
# Import module.jq file:
import "relative/path/to/module" as foo;
# Use the module's defs as foo::<def-name>
To import a JSON file:
# Read file.json:
import "relative/path/to/file" as $foo;
#
# Use as $foo::foo
Using `-L` now drops the builtin library path and appends the requested path to the empty array (or the result of an earlier `-L`).
Support for the `$JQ_LIBRARY_PATH` environment variable has been removed.
reading declarations
Changes to tests/modules/a.jq. All files
@@ -1,2 +1,2 @@-module a {version:1.7};+module {version:1.7}; def a: "a";