Replies: 1 comment
-
This has been forked to an independent library to make it easier to discover and use: https://github.com/tliron/commonjs-goja |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I hope everyone is aware of dop251's work on NodeJS compatibility work for goja.
I personally needed something different, specifically something that was more extensible for DSL-like environments in which I implement the CommonJS "require" in very specific ways (e.g. loading scriptlets from a graph database), as well as adding extra modular "globals" with extra API functionality., I also needed a precompiler that could translate JavaScript-extended languages (think TypeScript but not exactly...).
To this end I created my own CommonJS support for goja. The code is here (Apache licensed). The main class is Environment, from which you can do a Require for your starting point and have the rest of the magic happen.
As it stands at the moment, the code is very much tied to my ecosystem. Specifically it uses my URL library, which provides powerful support for referencing entries inside Zip files, even if they are on HTTP, as well as my logging wrapper.
I would like to see what the community thinks about it and to see if there's any way we can make it more neutral and perhaps even committed to goja's codebase.
Beta Was this translation helpful? Give feedback.
All reactions