The emscripten-library-generator (v0.3.0) converts normal JavaScript libraries into Emscripten's custom JS library format (.js) for use with the --js-library flag. It also auto-generates EXPORTED_FUNCTIONS lists via the --unresolved flag. Created by Emscripten author Evan Wallace, it resolves dependencies and prefixes symbols with underscores to match Emscripten's ABI. Development appears complete as of 2015; no recent releases. Unlike manual library authoring, it automates dependency resolution and underscore prefixing.
npm install emscripten-library-generatorNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows installation and generation of an Emscripten library from a simple JS file with dependencies.
Put initialization code into a JavaScript function called as the first statement inside main() in C++.
In C++ code, use the underscore-prefixed names (e.g., _Foo_new) or use EXPORTED_FUNCTIONS with underscores.
Use only ES5 syntax in input files.
Run 'npm install -g emscripten-library-generator' and ensure npm global binaries are in PATH.
Install acorn: 'npm install -g acorn' or install emscripten-library-generator locally and run via npx.
Rewrite input files in ES5 syntax (no arrow functions, const/let, etc.).
No dependency data recorded yet.