Kamailio uses Ducktape 2 without module-node or module-ducktape, requiring all routing in a single file.
https://wiki.duktape.org/howtomodules
I'm attempting to add module-node support and creating this issue to track with PR.
Response from mailing list
Hello,
I didn't notice that require() was not in the duktape 2.x, I will try to add support for module-duktape when I get a chance. If someone wants to do it, pull requests are welcome -- it does not seem to be complex:
- https://github.com/svaarala/duktape/tree/master/extras/module-duktape
The module-node sounds interesting, but not being familiar with node.js, looks it need more work to enable it:- https://github.com/svaarala/duktape/tree/master/extras/module-node
Cheers,
Daniel
Include the required() JS file
var test = require('./test');
Calling require() in a JSDT script throws TypeError: undefined not callable
ERROR: app_jsdt [app_jsdt_api.c:448]: jsdt_kemi_load_script(): failed running: TypeError: undefined not callable
I played around a little with module-duktape
but wasn't smart enough to define a Duktape.modSearch()
that would work as desired. I'm probably missing something obvious. I've recently been playing with asterisk/node-ari-client
which got me curious if module-node
might be more aligned with thinking.
—
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.
You are receiving this because you are subscribed to this thread.