-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
Open
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.
Description
I am looking at the possibility at doing something like mitogen in node.
How it would work, in really broad strokes, is :
- Spawn an child node process through sudo/ssh/whatever. Initial code is passed with
-e. - This initial code reads commands from stdin, push results on stdout
- One command is EVAL, which just evals a javascript string
- ESM modules imported by the evaluated code are expected to be imported from the parent context. It therefore needs a loader hook which would communicate (via stdin/stdout) to get the module from the parent
However, it's impossible generally to pass a meaningful --loader argument to the child : think of the case of a read-only file-system where we cannot write a temporary loader.mjs that does the job, for example.
In the Python world, mitogen just dynamically add a module loader. It would be nice if we could do the same thing, something in the lines of :
import.meta.hooks = {
async resolve() { ... },
...
}
DerekNonGeneric and kirkouimet
Metadata
Metadata
Assignees
Labels
esmIssues and PRs related to the ECMAScript Modules implementation.Issues and PRs related to the ECMAScript Modules implementation.