can javy used to compile a nodejs project ?
i think this line is the reason throw error,
const mathjs = require('mathjs');
so the javy can not used to compile a nodejs project ?
the errors is below:
thread 'main' panicked at 'called Result::unwrap() on an Err value: Uncaught ReferenceError: 'require' is not defined
at RUST_BACKTRACE=1 environment variable to display a backtrace
Error: failed to run main module index.wasm
Caused by:
0: failed to invoke command default
1: error while executing at wasm backtrace:
0: 0x112d1 - unreachable instruction executed
No, Javy cannot be used to compile a NodeJS project.
What you may be able to do if you want to use require to work with JS packages, is use a transpiler like rollup.js to convert your code and its dependencies to a single JS file and then execute that with Javy. However, NodeJS APIs that are outside of what QuickJS provides are not supported.
What you may be able to do if you want to use
requireto work with JS packages, is use a transpiler like rollup.js to convert your code and its dependencies to a single JS file and then execute that with Javy. However, NodeJS APIs that are outside of what QuickJS provides are not supported.
thanks, it's very helpful.