Last change
on this file since 6a80231 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
577 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | # @webassemblyjs/wasm-parser
|
---|
| 2 |
|
---|
| 3 | > WebAssembly binary format parser
|
---|
| 4 |
|
---|
| 5 | ## Installation
|
---|
| 6 |
|
---|
| 7 | ```sh
|
---|
| 8 | yarn add @webassemblyjs/wasm-parser
|
---|
| 9 | ```
|
---|
| 10 |
|
---|
| 11 | ## Usage
|
---|
| 12 |
|
---|
| 13 | ```js
|
---|
| 14 | import { decode } from "@webassemblyjs/wasm-parser";
|
---|
| 15 | import { readFileSync } from "fs";
|
---|
| 16 |
|
---|
| 17 | const binary = readFileSync("/path/to/module.wasm");
|
---|
| 18 |
|
---|
| 19 | const decoderOpts = {};
|
---|
| 20 | const ast = decode(binary, decoderOpts);
|
---|
| 21 | ```
|
---|
| 22 |
|
---|
| 23 | ### Decoder options
|
---|
| 24 |
|
---|
| 25 | - `dump`: print dump information while decoding (default `false`)
|
---|
| 26 | - `ignoreCodeSection`: ignore the code section (default `false`)
|
---|
| 27 | - `ignoreDataSection`: ignore the data section (default `false`)
|
---|
| 28 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.