js2wc
v1.0.11
Published
Wrap js into wasm cpp source code to make it can be compiled with emcc
Downloads
3
Readme
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 init
in 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.js
anda.out.wasm
- Run
node a.out.js
, this will printHello World
to console