ability to specify a bootstrap script [DISCUSSION]
this adds the option to include a bootstrap script to be run before the passed in script argument.
the use case for this would be to bootstrap the environment, such as allowing for shims etc to be loaded into the global context:
bootstrap.js:
var _require = global.require;
global.require = function (path) {
print("Loading " + path);
return _require(path);
};
var _print = global.print;
global.print = function (data) {
_print("data => " + data);
};
$ dukluv -b ./bootstrap.js repl.js
opening as discussion since overwriting require does not seem to work, but overwriting anything else, or inserting it into global does seem to.
overriding Duktape.modResolve() does work in the bootstrap, which might be enough to make this work.
to see it in action:
https://github.com/JerrySievert/duk_modules
Sorry I missed this, are you still trying to get it in?
Wow. Had forgotten about this one. Will take a look tonight and review.