Trying to understand how to import functions and objects from another js file with pdjs by @mganss, but I can't figure how!
modules.js:
var o = {foo: 0};
include("test_require.mjs",o);
// var req = require("test_require.mjs");
function bang() {
post('------------');
post("o.foo =", o.foo);
post("foo =", foo);
post('------------');
post('req.bar =', req.bar);
post('req.bar() =', req.bar());
post('------------');
};
test_require.mjs
const foo = 37;
function bar () {
post("require bar");
}
Patch
Pd Console:
Thanks any advance!