Installation¶
Vexy JSON ships as several packages built from one Cargo workspace. Install the one that matches the language you work in. All packages share one version number.
Rust library¶
Prerequisites: a Rust toolchain with Cargo.
-
Add the crate to your project:
Or add it to
Cargo.tomlby hand: -
Build the project with
cargo build.
The vexy-json crate re-exports the parser from vexy-json-core. Its default
serde feature also pulls in vexy-json-serde. To build without it, turn off
default features:
The workspace publishes these crates to crates.io:
| Crate | Contents |
|---|---|
vexy-json |
High-level crate that re-exports the parser API |
vexy-json-core |
Lexer, parser, repair, streaming and transform modules |
vexy-json-cli |
The vexy-json command-line program |
vexy-json-serde |
SerdeValue, a Serde wrapper around Value |
vexy-json-wasm |
WebAssembly bindings (built with wasm-pack) |
vexy-json-c-api |
C ABI, built as a static and a dynamic library |
Command-line tool¶
With Cargo¶
-
Install the CLI crate:
-
Check the installation:
The command prints the program name and version, for example
vexy_json 1.5.13.
From a GitHub release¶
Each tagged release on the releases page carries prebuilt binaries:
vexy-json-<version>-linux-x86_64.tar.gzand…-linux-aarch64.tar.gzvexy-json-<version>-macos-x86_64.tar.gz,…-macos-aarch64.tar.gz, a universal…-macos.zipand a…-macos.dmginstallervexy-json-<version>-windows-x86_64.zip
Unpack the archive and put the vexy-json binary (vexy-json.exe on Windows)
on your PATH.
From a source checkout¶
install.sh in the repository root builds the CLI and installs it under
~/.local (the binary goes to ~/.local/bin). It also builds and installs
the Python extension; see below.
The prefix can also come from the VEXY_JSON_PREFIX environment variable.
Python package¶
Prerequisites: Python 3.8 or later. The PyPI distribution is named
vexy-json; the import name is vexy_json.
uv add vexy-json # in a uv-managed project
uv pip install vexy-json # into the active environment
pip install vexy-json # with pip
Check the installation:
The package contains a compiled extension module (vexy_json._vexy_json)
built from crates/python with maturin and PyO3. If no prebuilt wheel exists
for your platform, the installer builds it from the source distribution, which
needs a Rust toolchain.
./install.sh in a source checkout builds a wheel for the system Python
selected by uv python find --system --no-managed-python and installs it with
uv pip install --system.
WebAssembly module¶
The WebAssembly bindings are not published to npm. Use one of these sources:
- Release archive. Each GitHub release has a
vexy-json-wasm-<version>.tar.gzasset with thewasm-packoutput (pkg/). - Hosted copy. The documentation site serves the current build at
https://vexy.dev/vexy-json/pkg/vexy_json_wasm.js. The demo loads it from there. -
Build it yourself. Prerequisites: Rust with the
wasm32-unknown-unknowntarget andwasm-pack.-
Run the build script from the repository root:
-
Collect the output from
src_docs/md/pkg/:vexy_json_wasm.js,vexy_json_wasm_bg.wasm, the TypeScript declarations andpackage.json.
-
The build uses wasm-pack build --target web, so the module is an ES module
with a default init export. See JavaScript and WebAssembly.
C and C++ library¶
Prerequisites: a Rust toolchain and a C or C++ compiler.
-
Build the library:
Cargo writes
libvexy_json_c_api.aand the platform's dynamic library (libvexy_json_c_api.dylib,.soor.dll) totarget/release/. -
Add
crates/c-api/includeto your include path. It holdsvexy_json.h, which C and C++ code can include. -
Link against the library. See C and C++ for an example.