#wasmer #pack #commands #wapm

wasmer-pack

A code generator that lets you treat WebAssembly modules like native dependencies

7 releases

0.7.0 Feb 10, 2023
0.6.0 Dec 28, 2022
0.5.3 Dec 2, 2022
0.5.2 Nov 24, 2022
0.5.0-rc.1 Oct 31, 2022

#710 in WebAssembly

Download history 44/week @ 2022-11-27 18/week @ 2022-12-04 14/week @ 2022-12-11 10/week @ 2022-12-18 38/week @ 2022-12-25 7/week @ 2023-01-01 10/week @ 2023-01-08 18/week @ 2023-01-15 19/week @ 2023-01-22 47/week @ 2023-01-29 74/week @ 2023-02-05 28/week @ 2023-02-12 37/week @ 2023-02-19 30/week @ 2023-02-26 12/week @ 2023-03-05 5/week @ 2023-03-12

89 downloads per month
Used in 2 crates (via wasmer-pack-cli)

MIT license

1.5MB
1.5K SLoC

Wasmer Pack

Continuous integration

(API Docs | Project Docs)

Import your WebAssembly code just like any other dependency.

Getting Started

The easiest way to get started by installing with the wasmer-pack CLI.

$ cargo install wasmer-pack-cli
$ wasmer-pack --version
wasmer-pack-cli 0.5.2

We also need the WAPM package we are generating bindings for. One option is to create your own, but for convenience we'll use the wasmer/wasmer-pack-cli package from WAPM.

$ curl -sSO https://registry-cdn.wapm.io/packages/wasmer/wasmer-pack-cli/wasmer-pack-cli-0.5.2.tar.gz
$ tar -xzvf wasmer-pack-cli-0.5.2.tar.gz
$ tree .
.
├── wapm.toml
├── wasmer-pack-cli-0.5.2.tar.gz
└── wasmer-pack.wasm

0 directories, 2 files

Now we've got everything we need to generate Python bindings to the wasmer/wasmer-pack-cli package.

$ wasmer-pack python . --out-dir ./py
$ tree py
py
├── MANIFEST.in
├── pyproject.toml
└── wasmer_pack_cli
    ├── commands
       ├── __init__.py
       └── wasmer_pack.wasm
    ├── __init__.py
    └── py.typed

2 directories, 6 files

We can generate JavaScript bindings with a similar command

$ wasmer-pack js . --out-dir ./js
$ tree ./js
./js
└── package
    ├── package.json
    └── src
        ├── commands
           ├── wasmer-pack.d.ts
           ├── wasmer-pack.js
           └── wasmer-pack.wasm
        ├── index.d.ts
        └── index.js

3 directories, 6 files

Check out the tutorial for more.

License

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.

Dependencies

~9.5MB
~215K SLoC