1.0.11 • Published 7 years ago
js2wc v1.0.11
js2wc
Wrap js into wasm cpp source code to make it can be compiled with emcc
Why js2wc
We want to protected our code
Workflow
- Run
npm initin a empty directory - Create a file named main.js and input code
console.log("Hello World"); - Run
node node_modules/js2wc/cli.js --input=main.js, this will create a file namedmain.cpp - Run
emcc -std=c++11 -Wall --bind main.cpp, this will create two files nameda.out.jsanda.out.wasm - Run
node a.out.js, this will printHello Worldto console