13 releases (7 breaking)

0.7.0 May 15, 2024
0.6.0 Mar 27, 2024
0.1.0 Dec 27, 2023

#958 in WebAssembly

Download history 22/week @ 2024-04-01 83/week @ 2024-04-08 177/week @ 2024-05-06 194/week @ 2024-05-13 21/week @ 2024-05-20 16/week @ 2024-05-27 15/week @ 2024-06-03 9/week @ 2024-06-10 14/week @ 2024-06-17 2/week @ 2024-06-24 38/week @ 2024-07-01 3/week @ 2024-07-08 8/week @ 2024-07-15

52 downloads per month
Used in tinywasm

MIT/Apache

84KB
1.5K SLoC

tinywasm-parser

This crate provides a parser that can parse WebAssembly modules into a TinyWasm module. It uses my fork of the wasmparser crate that has been modified to be compatible with no_std environments.

Features

  • std: Enables the use of std and std::io for parsing from files and streams.
  • logging: Enables logging of the parsing process using the log crate.

Usage

use tinywasm_parser::Parser;
let bytes = include_bytes!("./file.wasm");

let parser = Parser::new();
let module = parser.parse_module_bytes(bytes).unwrap();
let mudule = parser.parse_module_file("path/to/file.wasm").unwrap();
let module = parser.parse_module_stream(&mut stream).unwrap();

lib.rs:

See tinywasm for documentation.

Dependencies

~3.5MB
~61K SLoC