eduardosm / rsjsonnet

A Rust implementation of the Jsonnet language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rsjsonnet

GitHub Actions Status MSRV

A Rust implementation of the Jsonnet language. Currently, it targets Jsonnet version 0.20.

This project provides three crates:

  • rsjsonnet: a command line program with an interface similar to the official implementation.
  • rsjsonnet-lang: a library that provides parsing and evaluation of Jsonnet programs.
  • rsjsonnet-front: a library built on top of rsjsonnet-lang and provides easy source loading and error printing.

Command line program

Pre-built binaries

You can download binaries of the command line for Linux and Windows from the GitHub releases page.

Build from source

If you have a Rust toolchain installed on your system, you can build the latest version with:

cargo install --locked rsjsonnet

Usage

rsjsonnet provides a command line interface similar to the one of the official implementation.

Usage: rsjsonnet [OPTIONS] <filename>

Arguments:
  <filename>

Options:
  -e, --exec                      Treat filename as code
  -J, --jpath <dir>               Specify an additional library search dir (right-most wins)
  -o, --output-file <file>        Write to the output file rather than stdout
  -m, --multi <dir>               Write multiple files to the directory, list files on stdout
  -y, --yaml-stream               Write output as a YAML stream of JSON documents
  -S, --string                    Expect a string, manifest as plain text
  -s, --max-stack <n>             Number of allowed stack frames
  -t, --max-trace <n>             Max length of stack trace before cropping
  -V, --ext-str <var=[val]>
      --ext-str-file <var=file>
      --ext-code <var[=code]>
      --ext-code-file <var=file>
  -A, --tla-str <var[=val]>
      --tla-str-file <var=file>
      --tla-code <var[=code]>
      --tla-code-file <var=file>
  -h, --help                      Print help

License

Licensed under either of

at your option.

The following are taken from the C++ implementation, which is licensed under Apache 2.0.

About

A Rust implementation of the Jsonnet language

License:Apache License 2.0


Languages

Language:Rust 72.5%Language:Jsonnet 26.6%Language:Shell 0.9%