If it is just to include modules in a binary (like with repl.js in qjs),
you can already do it with the "-c" option (compile to C source). Then
you need to manually load each module in your program (see JS_EvalBinary()).
But It is a minor issue compared to writing a node compatibility layer !
Best regards,
Fabrice.
On 8/21/19 4:22 PM, Mario Gliewe wrote:
Or did i miss smthg?I was thinking to work on a node-compat layer, so some of the
node-builtins can be written in js, such as eents/buffer/stream/net/etc.
could be beneficial to be able to use the huge npm repo at some extent.
greets maG
On 21.08.19 16:20, Fabrice Bellard wrote:
It is not possible yet (shared libs are only supported for C modules).
What is your use case ?
Best regards,
Fabrice.
On 8/21/19 2:58 PM, Mario Gliewe wrote:
Hi,
is there a way to use qjsc to precompile javascript modules, and use
them as shared libs?
Or, even better, register such precompilations as known/builtin modules
into the qjs binary?
I noticed the -M flag for qjsc, but couldn't quiet figure out what that
is for or how it works..
greets maG