Registry / devops / emscripten-library-generator

emscripten-library-generator

JSON →
library0.3.0jsnpmunverified

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-generator
INSTALL
IMPORT
SIG · EMSCRIPTEN-LIBRARY
E
emscripten-library-generator
devopsjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CLI tool
npm install -g emscripten-library-generator
This is a CLI tool, not a library. Install globally and run via emscripten-library-generator.

Shows installation and generation of an Emscripten library from a simple JS file with dependencies.

npm install -g emscripten-library-generator echo 'var counter = 0; function increment() { counter++; return counter; } function increment_double() { increment(); return counter * 2; }' > input.js emscripten-library-generator input.js > library.js cat library.js
emscripten-library-generator --version
Debug
Known issues
gotchaTop-level statements other than variable or function declarations are not supported.
fix
Put initialization code into a JavaScript function called as the first statement inside main() in C++.
affects: >=0.0.0
gotchaAll global symbols are automatically prefixed with an underscore to match Emscripten's output.
fix
In C++ code, use the underscore-prefixed names (e.g., _Foo_new) or use EXPORTED_FUNCTIONS with underscores.
affects: >=0.0.0
gotchaThe tool may not work with modern JavaScript features (ES6+).
fix
Use only ES5 syntax in input files.
affects: >=0.0.0
Errors
Common errors & fixes
sh: emscripten-library-generator: command not found
The tool is not installed globally or not in PATH.
fix
Run 'npm install -g emscripten-library-generator' and ensure npm global binaries are in PATH.
Error: Cannot find module 'acorn'
Missing dependency; old version of emscripten-library-generator may require acorn.
fix
Install acorn: 'npm install -g acorn' or install emscripten-library-generator locally and run via npx.
SyntaxError: Unexpected token ...
Input JavaScript uses ES6+ syntax not supported by the parser.
fix
Rewrite input files in ES5 syntax (no arrow functions, const/let, etc.).
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
emscripten-library-generator — npm install emscripten-library-generator · libregistry