This repository has been archived by the owner. It is now read-only.
Eliminate unused functions in your WASM binary
Clone or download
Sven SAULEAU Update
Latest commit fa1651b Feb 26, 2018
Failed to load latest commit information.
src fix: remove console logs Feb 19, 2018
test chore: bump webassembly-interpreter Feb 15, 2018
.gitignore feat: initial commit Feb 10, 2018
.travis.yml feat: ref counting Feb 11, 2018 docs: fix ALGORITHMS Feb 15, 2018 Update Feb 26, 2018
package-lock.json 1.0.2 Feb 20, 2018
package.json 1.0.2 Feb 20, 2018

This repo has been moved



Eliminate unused functions in your WASM binary.


  • Removes the export instruction
  • Replaces the func with an empty one (to preserve the index)


-   (func $func_1 (param i32) (param i32) (result i32)
-     (get_local 0)
-     (get_local 1)
-     (i32.add)
-   )
-   (export "add" (func $func_1))
+   (func)


Why not use binaryen?

First you can see the JavaScript API is specified here

I encounter some issues (like removing the func wasn't working) and added an additional parse of the WASM file.

Third party licenses


  • Support DCE for exported global, memory, table.
  • Remove elements only used by this function (other imports, data, etc).
  • Add CLI for node projects or libs