38 releases (3 stable)

1.0.2 Feb 5, 2021
1.0.0-rc1 Dec 23, 2020
1.0.0-alpha5 Nov 6, 2020
0.17.1 Jun 24, 2020
0.5.7 Jul 23, 2019

#8 in WebAssembly

Download history 34/week @ 2020-12-20 53/week @ 2020-12-27 241/week @ 2021-01-03 293/week @ 2021-01-10 383/week @ 2021-01-17 203/week @ 2021-01-24 122/week @ 2021-01-31 391/week @ 2021-02-07 312/week @ 2021-02-14 374/week @ 2021-02-21 437/week @ 2021-02-28 264/week @ 2021-03-07 220/week @ 2021-03-14 332/week @ 2021-03-21 310/week @ 2021-03-28 373/week @ 2021-04-04

1,036 downloads per month
Used in less than 8 crates

MIT license

460KB
9K SLoC

wasmer-wasi Build Status Join Wasmer Slack MIT License crates.io

This crate provides the necessary imports to use WASI easily from Wasmer.

Usage

use wasmer::{Store, Module, Instance};
use wasmer_wasi::WasiState;

let store = Store::default();
let module = Module::from_file(&store, "my_wasi_module.wasm")?;

// Create the WasiEnv
let wasi_env = WasiState::new("command name")
    .args(&["world"])
    .env("KEY", "VALUE")
    .finalize()?;

let import_object = wasi_env.import_object(&module)?;
let instance = Instance::new(&module, &import_object)?;

let start = instance.exports.get_function("_start")?;
start.call(&[])?;

Note: you can find a full working example using WASI here.

Dependencies

~4.5MB
~94K SLoC