Import your WebAssembly code just like any other dependency.
The easiest way to get started by installing with the wasmer-pack
CLI.
console
$ cargo install --git https://github.com/wasmerio/wasmer-pack
$ wasmer-pack --version
wasmer-pack-cli 0.2.3
Now we've got everything we need to generate Python bindings to the wasmer-pack
package.
```console $ wasmer-pack python tutorial-01-0.1.0.webc --out-dir py $ tree ./py ./py ├── MANIFEST.in ├── pyproject.toml └── tutorial01 ├── bindings │ ├── helloworld │ │ ├── bindings.py │ │ ├── init.py │ │ └── tutorial-01.wasm │ └── init.py ├── init.py └── py.typed
3 directories, 8 files ```
We can generate JavaScript bindings with a similar command
```console $ wasmer-pack js tutorial-01-0.1.0.webc --out-dir js $ tree ./js ./js └── package ├── package.json └── src ├── bindings │ ├── hello-world │ │ ├── hello-world.d.ts │ │ ├── hello-world.js │ │ ├── intrinsics.js │ │ └── tutorial-01.wasm │ ├── index.d.ts │ └── index.js ├── index.d.ts └── index.js
4 directories, 9 files ```
Check out the tutorial for more.
This project is licensed under the MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT).
It is recommended to always use cargo crev
to verify the
trustworthiness of each of your dependencies, including this one.