zkppzapp-wasm 中文文档教程
wasm-pack-template
使用 wasm-pack 启动 Rust 和 WebAssembly 项目的模板。教程 <跨度> | 聊天
用 ?????构建作者:Rust 和 WebAssembly 工作组关于
该模板旨在将 Rust 库编译成 WebAssembly 和 将生成的包发布到 NPM。
请务必查看其他wasm-pack
在线教程对于其他 wasm-pack
的模板和用法。
????用法
????使用 cargogenerate
克隆此模板
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
??????️ 使用 wasm-pack build
构建
wasm-pack build
????使用 wasm-pack test
在无头浏览器中进行测试
wasm-pack test --headless --firefox
????使用 wasm-packpublish
发布到 NPM
wasm-pack publish
???包含电池
wasm-bindgen
用于通信 WebAssembly 和 JavaScript 之间。console_error_panic_hook
用于将紧急消息记录到开发人员控制台。wee_alloc
,优化的分配器 对于小代码大小。LICENSE-APACHE
和LICENSE-MIT
:大多数 Rust 项目都是以这种方式获得许可的,因此这些项目都包含
Apache许可证
在
- 2.0 版 (LICENSE-APACHE 或 http://www.apache.org/licenses/LICENSE-2.0)
- MIT 许可证 (LICENSE-MIT 或 http://opensource.org/licenses/MIT),
由您选择。
贡献
除非您另有明确说明,否则任何贡献都是有意为之 根据 Apache-2.0 中的定义,提交以包含在您的作品中 许可,应如上所述获得双重许可,没有任何附加条款或 状况。
wasm-pack-template
A template for kick starting a Rust and WebAssembly project using wasm-pack.Tutorial | Chat
Built with ???????? by The Rust and WebAssembly Working GroupAbout
???? Read this template tutorial! ????
This template is designed for compiling Rust libraries into WebAssembly and publishing the resulting package to NPM.
Be sure to check out other wasm-pack
tutorials online for other templates and usages of wasm-pack
.
???? Usage
???? Use cargo generate
to Clone this Template
Learn more about cargo generate
here.
cargo generate --git https://github.com/rustwasm/wasm-pack-template.git --name my-project
cd my-project
????️ Build with wasm-pack build
wasm-pack build
???? Test in Headless Browsers with wasm-pack test
wasm-pack test --headless --firefox
???? Publish to NPM with wasm-pack publish
wasm-pack publish
???? Batteries Included
wasm-bindgen
for communicating between WebAssembly and JavaScript.console_error_panic_hook
for logging panic messages to the developer console.wee_alloc
, an allocator optimized for small code size.LICENSE-APACHE
andLICENSE-MIT
: most Rust projects are licensed this way, so these are included for you
License
Licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.