11 releases (6 breaking)

0.6.0 Mar 27, 2024
0.5.0 Mar 1, 2024
0.4.1 Feb 3, 2024
0.4.0 Jan 30, 2024
0.0.5 Dec 19, 2023

#646 in WebAssembly

Download history 2/week @ 2023-12-18 10/week @ 2023-12-25 12/week @ 2024-01-08 7/week @ 2024-01-22 20/week @ 2024-01-29 8/week @ 2024-02-19 127/week @ 2024-02-26 27/week @ 2024-03-04 118/week @ 2024-03-11 125/week @ 2024-03-25 36/week @ 2024-04-01

281 downloads per month
Used in tinywasm

MIT/Apache

83KB
2K 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