|
1 | 1 | # Sjsonnet |
2 | | -A Scala implementation of the [Jsonnet](https://jsonnet.org/) configuration language, running on JVM, Scala Native and JavaScript. |
| 2 | +A Scala implementation of the [Jsonnet](https://jsonnet.org/) configuration language, running on JVM, GraalVM, Scala Native and JavaScript. |
3 | 3 |
|
4 | | -## Usage |
| 4 | +## Usage as a CLI |
| 5 | +We release standalone executables JARs, Scala Native and GraalVM in the [github release page](https://github.com/databricks/sjsonnet/releases): |
| 6 | + |
| 7 | +```bash |
| 8 | +$ chmod +x sjsonnet.jar |
| 9 | + |
| 10 | +$ ./sjsonnet.jar |
| 11 | +Missing argument: file <str> |
| 12 | +Expected Signature: Sjsonnet |
| 13 | +usage: sjsonnet [sjsonnet-options] script-file |
| 14 | + -A --tla-str <str> <var>[=<val>] Provide top-level arguments as string. 'If <val> is |
| 15 | + omitted, get from environment var <var> |
| 16 | + -J --jpath <str> Specify an additional library search dir (left-most wins unless |
| 17 | + reverse-jpaths-priority is set) |
| 18 | + -S --string Expect a string, manifest as plain text |
| 19 | + -V --ext-str <str> <var>[=<val>] Provide 'external' variable as string. 'If <val> is |
| 20 | + omitted, get from environment var <var> |
| 21 | + -V --ext-code <str> <var>[=<code>] Provide 'external' variable as Jsonnet code. If |
| 22 | + <code> is omitted, get from environment var <var> |
| 23 | + -V --tla-code <str> <var>[=<val>] Provide top-level arguments as Jsonnet code. 'If |
| 24 | + <val> is omitted, get from environment var <var> |
| 25 | + -c --create-output-dirs Automatically creates all parent directories for files |
| 26 | + --debug-importer Print some additional debugging information about the importer |
| 27 | + -e --exec Evaluate the given string as Jsonnet rather than treating it as a |
| 28 | + file name |
| 29 | + --ext-code-file <str> <var>=<file> Provide 'external' variable as Jsonnet code from the |
| 30 | + file |
| 31 | + --ext-str-file <str> <var>=<file> Provide 'external' variable as string from the file |
| 32 | + --fatal-warnings Fail if any warnings were emitted |
| 33 | + file <str> The jsonnet file you wish to evaluate |
| 34 | + -m --multi <str> Write multiple files to the directory, list files on stdout |
| 35 | + -n --indent <int> How much to indent your output JSON |
| 36 | + -o --output-file <str> Write to the output file rather than stdout |
| 37 | + -p --preserve-order Preserves order of keys in the resulting JSON |
| 38 | + --reverse-jpaths-priority If set, reverses the import order of specified jpaths (so that the |
| 39 | + rightmost wins) |
| 40 | + --strict Enforce some additional syntax limitations |
| 41 | + --throw-error-for-invalid-sets Throw an error if a set operation is used on a non-set |
| 42 | + --tla-code-file <str> <var>=<file> Provide top-level arguments variable as Jsonnet code |
| 43 | + from the file |
| 44 | + --tla-str-file <str> <var>=<file> Provide top-level arguments variable as string from |
| 45 | + the file |
| 46 | + -y --yaml-stream Write output as a YAML stream of JSON documents |
| 47 | + --yaml-debug Generate source line comments in the output YAML doc to make it |
| 48 | + easier to figure out where values come from. |
| 49 | + --yaml-out Write output as a YAML document |
| 50 | +
|
| 51 | +$ ./sjsonnet.jar foo.jsonnet |
| 52 | +``` |
| 53 | +
|
| 54 | +
|
| 55 | +## Usage as a library |
5 | 56 |
|
6 | 57 | Sjsonnet can be used from Java and Scala: |
7 | 58 |
|
@@ -37,22 +88,6 @@ sjsonnet.SjsonnetMain.main0( |
37 | 88 | ); |
38 | 89 | ``` |
39 | 90 |
|
40 | | -As a standalone executable assembly from the [github release page](https://github.com/databricks/sjsonnet/releases): |
41 | | -```bash |
42 | | -$ chmod +x sjsonnet.jar |
43 | | - |
44 | | -$ ./sjsonnet.jar |
45 | | -error: Need to pass in a jsonnet file to evaluate |
46 | | -usage: sjsonnet [sjsonnet-options] script-file |
47 | | - |
48 | | - -n, --indent How much to indent your output JSON |
49 | | - -J, --jpath Specify an additional library search dir (left-most wins) |
50 | | - -o, --output-file Write to the output file rather than stdout |
51 | | - ... |
52 | | - |
53 | | -$ ./sjsonnet.jar foo.jsonnet |
54 | | -``` |
55 | | - |
56 | 91 | Or from Javascript: |
57 | 92 |
|
58 | 93 | Since `0.5.3`, the output is a CommonJS module. |
|
0 commit comments