Crates.io | web |
lib.rs | web |
version | 0.2.12 |
source | src |
created_at | 2014-11-21 10:17:49.291437 |
updated_at | 2023-01-01 08:29:35.719706 |
description | A library for interacting with the web browser |
homepage | |
repository | https://github.com/richardanaya/js-wasm |
max_upload_size | |
id | 256 |
size | 77,392 |
A Rust library full of useful functions from various microlibraries for interacting with the web browser using js-wasm
.
[dependencies]
web = "0.1"
use web::*;
#[no_mangle]
pub fn main() {
set_interval(|| {
log(&format!("⏰ {}", random()));
}, 1000);
}
<html>
<head>
<script src="https://unpkg.com/js-wasm/js-wasm.js"></script>
<script type="application/wasm" src="helloworld.wasm"></script>
</head>
<body>
...
</body>
</html>
# cli commands for building web assembly
build:
@RUSTFLAGS='-C link-arg=-s' cargo build --target wasm32-unknown-unknown --release
@cp target/wasm32-unknown-unknown/release/helloworld.wasm .
lint:
@cargo fmt
serve:
python3 -m http.server 8080
This project is licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in web
by you, as defined in the Apache-2.0 license, shall be
dual licensed as above, without any additional terms or conditions.