The script build_wasm.sh
compiles go-jsonnet project to WASM and stores the result in the folder ./dist
.
For old versions of node you need to edit the file ./dist/wasm_exec.js
. After the line use strict
add line globalThis.crypto ??= require('crypto');
. Maybe more changes are needed: golang/go#53128.
The module ./libjsonnet
defines two function:
jsonnet_evaluate_snippet
: Wrapper for the corresponding jsonnet library functionevaluate
: Simplified interface. Only code and its external variables
For sample usage in Nodejs, see ../in-action/nodejs-cli/.