-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
lib: expose a global node
proxy in eval script and REPL
#42114
Conversation
This global is meant to be a convenient shortcut to access core modules.
what's the reasoning for this? all the core modules are already available as globals in the repl |
The idea would be to deprecate that. The problem with having Node.js specific globals is that it clashes with other globals (e.g. |
I haven't given this much thought yet, but I don't know if I am a fan of adding another global as the solution to "we added globals that are now a problem." |
The issue with crypto should be studied from the lens of scripts and libraries maintainers. Currently, code that is to be consumed by both client and server must feature-test the content of the crypto global to know what it is about. After several Node.js major versions are released, the old versions will keep being used in the wild, and so library maintainers will still need to feature-test the crypto global to figure out how to work with or without it. So on one hand the end-user benefits are non-existent. And on the other hand, the deprecation of fs, path and other globals in the REPL will noticeably reduce its usability for quick scripts. |
@aduh95 ping. Are we planning to work on this to get it to a closure? |
Not really. The idea implemented in this PR was to solve the clash for |
This global is meant to be a convenient shortcut to access core modules.
Unexpected global(s) found: node
test failures.