|0.2.1||Mar 10, 2021|
|0.2.0||Feb 28, 2021|
|0.1.5||Feb 15, 2021|
#819 in WebAssembly
30 downloads per month
create self-contained HTML programs
Want to run basic console programs in the browser?
Too lazy to configure CORS properly to fetch/share WASM?
Hate firing up a webserver when you'd rather just double click an HTML file?
Easily confused by advanced concepts such as "I have multiple files"?
--allow-file-access-from-files flags, no sidecar files, 100% self contained.
# install cargo install cargo-html # create a project cargo new hello-world cd hello-world # build a project cargo html # view/run said project in the browser start "" target/cargo-html/debug/hello-world.html
- as mentioned on HN: https://news.ycombinator.com/item?id=26089539
- upstream: https://github.com/Syn-Nine/rust-mini-games
- patches: https://github.com/MaulingMonkey/rust-mini-games
|knights||#6 File I/O not implemented (panic on exit)|
|lord||#7 Colors not supported (some terminal escape garbage)|
To reproduce the
gh-pages of my fork of that repository from scratch:
# init cargo install cargo-html git clone --branch cargo-html-demo https://github.com/MaulingMonkey/rust-mini-games cd rust-mini-games # build cargo html --release robocopy /S target/cargo-html/release . *.html # create branch git checkout -b gh-pages git add -A . git commit -m "Updated examples"
Portability: Generated HTML
- General awesomeness.
|Chrome for Android||✅ 88+|
|Firefox for Android||✔️ 85+|
|Opera Mobile||✔️ 59+|
|Opera Mini||❌ None (missing WASM, Async Functions, TextEncoder, BigInt)|
|iOS Safari||✔️ 14.4+|
|IE||❌ None (missing WASM, Async Functions, TextEncoder, BigInt)|
|Android Browser||✔️ 81+|
|UC Browser for Android||❌ None (missing WASM, BigInt)|
|Samsung Internet||✅ 9.2+|
|QQ Browser||❌ None (missing BigInt)|
|Baidu Browser||❌ None (missing WASM, Async Functions, BigInt)|
|KaiOS Browser||❌ None (missing WASM, Async Functions, BigInt)|
|✔️||Should work, but untested, so probably broken - file issues!|
|❌||Broken (Browsers could probably be fixed via polyfills and different codegen?)|
Portability: Command Line
- cargo (typically installed via rustup)
- Prebuilt wasm-bindgen binaries (will auto-download appropriate versions.)
- Prebuilt wasm-opt binaries (will auto-download.)
- wasm-pack for
wasm_bindgensupport (will be auto-installed from source.)
- cargo-web for
stdwebsupport (will be auto-installed from source.)
- General awesomeness.
|OS X||✔️||❌BO||❌BO||❌BO||❌BO [...]|
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.
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.