-
Notifications
You must be signed in to change notification settings - Fork 81
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
Support for process.env
?
#32
Comments
Sure. You can use the BTW, goja supports |
Wow, I just wanted to say that implementing this was a very pleasant experience. I feared that there was lots of marshaling awaiting me, but at least the very minimal implementation to fulfill my use case worked out of the box. I deliberately added an unconditional fail to the tests because I couldn't believe how it just worked. And I am also in awe how far the ES6 support is by now. This is great news! |
The "process.env" part from #33 was already merged, so in that regard this issue has been solved. I think |
Sorry, forgot to close the issue. Feel free to go for those |
I have a JavaScript Library, namely immer.js that I would love to run in goja. Judging by the looks of it immer prefers to work with Proxy objects, but can explicitly made ES5 compatible. It's default
index.js
however expects to be run in a node.js compatible environment:This causes a
ReferenceError: process is not defined at main.js:5135:7(1)
when I try to load a file that has been put together by Rollup.I'm explicitly not asking to implement all of the node
Process
API, onlyprocess.env
. From my (very limited) understanding this would require an object namedprocess
with aenv
property to be made available in the global namespace. The values could probably be retrieved fromos.Environ()
.Would such a PR be accepted and a good "first" kind of issue to explore the codebase?
The text was updated successfully, but these errors were encountered: