cue-wasm
v1.0.0
Published
<div align="center">
Downloads
261
Readme
:notebook_with_decorative_cover: Table of Contents
:dart: Features
- Cue to json
cue.toJSON() - Cue to js object
cue.parse() - Highly optimized - 2.1MB gzipped bundle size when using "slim" variant, 4.2MB for "full"
:toolbox: Getting Started
:gear: Installation
Install cue-wasm with yarn
yarn add cue-wasm:running: Build Locally
Clone the project
git clone https://github.com/dclareio/cue-wasm.gitGo to the project directory
cd cue-wasmInstall dependencies
yarnBuild the library (requires docker)
yarn build:eyes: Usage
import CUE from 'cue-wasm'
const cue = await CUE.init();
// basic API
cue.parse('hello: "world"') // returns { hello: "world" }
// Tagged template literals
const mergeObj = { test: "test" }
const obj = cue`
key: "val"
test: string
${mergeObj}
`; // returns { test: "test", key: "val" }
// note that for strings you'll need to quote them manually if you
// don't want cue to interpret them literally. This allows dynamically
// writing cue e.g.
cue`test: ${"test"}` // evaluates `test: test` vs.
cue`test: "${"test"}"` // evaluates `test: "test"`:compass: Roadmap
- [x] CUE -> JSON/JS
- [X] CUE -> OpenAPI
- [X] CUE -> JSONSchema
- [X] CUE -> AST
- [ ] CUE -> Typescripe Types
- [ ] CUE -> Protobufs
- [ ] JSON/JS -> CUE
- [ ] JSONSchema -> CUE
- [ ] Typescripe Types -> CUE
- [ ] Protobufs -> CUE
:warning: License
Distributed under the MIT License. See LICENSE for more information.
:handshake: Contact
@dclario - https://dclare.io - [email protected] - We do consulting!!
Project Link: https://github.com/dclareio/cue-wasm
