-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Node.js built-in module support in the vm context #46558
Comments
Thanks for opening this @legendecas. Do you have any plan or idea for next steps towards a |
I'm experimenting with a local setup to expose Web globals like
|
Regarding |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request for 5 months and it is unlikely to be implemented. It will be closed 6 months after the last non-automated comment. For more information on how the project manages feature requests, please consult the feature request management document. |
There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the
never-stale
|
@mcollina @cjihrig @addaleax I tried to achieve something of this sort in my project and ended up creating a package. Can you guys have a look and see if this is relevant to what we need here ? https://github.com/karankraina/safer-vm/blob/main/src/context.ts The idea is from node core only - Line 204 in c7e4209
|
@karankraina not really. You are exposing the parent native objects, while we are talking about exposing them natively in child. This would ensure safety. |
Scripts/Modules running in the context created with
vm.createContext
can not access various Node.js built-in apis/modules likeURL
,node:assert
,node:http
, etc. This makes it cumbersome to create a disposable context for use cases like hot-module-reload to run existing node.js apps.We can provide a built-in API to create a
context
(or a newNodeRealm
for compatibility) with full-fledged Node.js built-in modules support. It allows object exchanges between realms and shares the same loop with the main context., similar to the existing
vm.context
./cc @mcollina @nodejs/realm @nodejs/vm
The text was updated successfully, but these errors were encountered: