JavaScript package for CUE using wasm #952
cueckoo
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
Original reply by @myitcv in cuelang/cue#952 (comment) @codewithcheese out of interest, how do you plan to version this? Because there are effectively two relevant versions that compose into the output: the Go version you used to build the WASM artefact, and the CUE version. On top of that you've got your "version" which effectively represents the progression of API you are establishing in your package. I just wonder how this scales as there are more Go versions, more CUE versions... and your API could change too? |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Originally opened by @codewithcheese in cuelang/cue#952
Hi CUEbies
I have created a npm packages for using CUE in node.js and browsers: https://www.npmjs.com/package/cuelang-js
It compiles the CUE cli to wasm and exports a function for calling commands along with providing arguments and flags. In node.js it reads from the local file system, in browser CUE reads and writes from an in-memory file system.
The CUE wasm is 26MB uncompressed using gzip its down to 4MB still a bit large for websites.
We at balena are starting to use CUE in many places. One of them is to replace JSON Schema for validation.
If you make use of the package feel free to drop me a note here, happy to accept issues and PRs on the repo.
Beta Was this translation helpful? Give feedback.
All reactions