Example node.js projects which bundle a C/C++ emscripten component by using emscripten-build-npm.
- Hello world - A C++ "Hello world" web application.
- Hello world with Make - A C++ web application built with Make by using the
emscripten-build
CLI. - Hello world with CMake - A C++ web application built with CMake by using an
emscripten-build
settings file. - Hello world with Autotools - A C++ web application built with Autotools and Make by using the
emscripten-build
JS API. - C++ library with JS bindings - A C++ library which is callable from JavaScript.
- SDL and OpenGL application - A 3D C++ "Hello triangle" web application.
- Web development server - A C++ web application with a development server that can reload changes live on your browser.
Clone this project to start experimenting with each example:
git clone https://github.com/devappd/emscripten-npm-examples
Before calling npm install
on these projects, you must have at least Python 3.6 on your system. You may download it at python.org, or refer to your OS's package manager.
Optionally, you should configure a custom install path for the emscripten SDK. Otherwise, the SDK will be duplicated into each project. Specify a custom path by modifying your NPM config via one of the following:
Method | Command |
---|---|
Commit the path to your user .npmrc |
npm config set emsdk "/your/install/path" |
Set an environment variable | set NPM_CONFIG_EMSDK=/your/install/path |
Use a config argument to NPM temporarily | npm [command] --emsdk="/your/install/path" |
MIT License except where noted.