Crates.io | wasmpng |
lib.rs | wasmpng |
version | 0.1.3 |
source | src |
created_at | 2021-09-23 10:06:19.590512 |
updated_at | 2022-11-24 12:44:36.190711 |
description | Combines a Javascript and WASM file into a single executable polygot PNG+HTML file |
homepage | https://github.com/datatrash/wasm-png |
repository | https://github.com/datatrash/wasm-png |
max_upload_size | |
id | 455288 |
size | 15,577 |
Combines a Javascript and WASM file into a single executable polygot PNG+HTML file.
Usage:
cargo install wasmpng
wasmpng --wasm-file my.wasm --js-file my.js
index.png.html
which will automatically unpack and execute, loading itself as a PNG and extracting the data from thereNOTE: By default file access is blocked in Chrome, so you can't test this locally unless you spin up an HTTP server. Start Chrome with the --allow-file-access-from-file
to remove this restriction.
The Javascript will receive the WASM as a regular array in arguments[0]
. See the examples
folder for an example.
You can also pass --max-width
to restrict the width of the generated PNG.
Inspiration and parts of the loader code come from pnginator by Gasman et al.