svaarala / duktape

Duktape - embeddable Javascript engine with a focus on portability and compact footprint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Load JS modules from C

acode-x opened this issue · comments

commented

Hi,

I am currently using duk_module_node to import modules in my JS files.

Is there a way to directly import the JS module/file from C (without usage of require('module') in my JS code), and push the same to global scope.
If so, should i call duk_peval_string twice (1 for the imported module and 1 for the main JS file)?