wasmexplorer-wasm-compiler
v3.3.0
Published
Compile `.c/++` files to `.wasm` format using [WasmExplorer](https://mbebenita.github.io/WasmExplorer/) service by [@mbebenita](https://github.com/mbebenita).
Downloads
5
Readme
wasmexplorer-wasm-compiler
Compile .c/++
files to .wasm
format using WasmExplorer service by @mbebenita.
Usage
const compile = require('wasmexplorer-wasm-compiler');
// compile(srcFilepath, dstFilepath, compilerOptions = {});
Arguments
srcFilepath
: Absolute path to source file.dstFilepath
: Absolute path to destination/compiled file.compilerOptions
: Options to pass to compiler. See the table below.
Compiler Options
| Option | Type | Default | Description |
| ------------------- | ------ | ------- | ------------------------------------------------------------------------------------------ |
| language
| string | C99 | The language to use. One of [C89, C99, C++98, C++11, C++14, C++1z] |
| optimisationLevel
| string | s | Optimisation level to apply. One of [0, 1, 2, 3, 4, s] |
| clean
| bool | false | Generate clean WAST |
| fastMath
| bool | false | Approximate floating point calculations for faster execution (may yield incorrect results) |
| noInline
| bool | false | Do not expand functions inline. |
| noRTTI
| bool | false | Do not generate runtime type information. |
| noExceptions
| bool | false | Disable exception handling. try/catch
will raise errors. |