@tdxvolt/volt-ws-protocol-web
v0.1.13
Published
Volt websocket protocol library for web
Downloads
7
Readme
volt-ws-protocol-web
This crate provides a lightweight shim wrapping the volt-ws-protocol
library for use in web applications, using the wasm-bindgen crate.
We could use the volt-ws-protocol-component
in combination with jco
instead of wasm-bindgen
to generate the javascript bindings, but the component workflow does not support the js feature of getrandom
or the use of chrono
for timestamps.
build and publish
To compile and publish the javascript package, run the following commands:
You may want to bump the patch version number in the cargo.toml
file.
Compile the Rust code to WebAssembly using wasm-pack:
cd volt-ws-protocol-web
wasm-pack build --release --target web --scope tdxvolt
Publish the package to npm:
cd pkg
npm publish --access public