.. | ||
src | ||
wit | ||
.gitignore | ||
javascript_decoder.wasm | ||
package-lock.json | ||
package.json | ||
README.md |
How to create and build the Javascript component:
- Create the
javascript_decoder
folder cd javascript_decoder
- Create
.gitignore
with contentnode_modules
npm install @bytecodealliance/jco @bytecodealliance/componentize-js binaryen
- Create the
src
folder with the fileindex.js
- Create the
wit
folder with the fileworld.wit
- Update code as needed
npx jco componentize src/index.js --wit wit/world.wit --out javascript_decoder.wasm && npx jco opt javascript_decoder.wasm --output javascript_decoder.wasm