dop251 / goja_nodejs

Nodejs compatibility library for Goja
MIT License
329 stars 78 forks source link

[Feature Request] Add a option for disable the `require` method when using EventLoop #64

Open zyxkad opened 11 months ago

zyxkad commented 11 months ago

I want to use eventloop, but I don't want the method require because I don't want the script can access my filesystem.

I can make a source loader that will always return an error, but the built-in modules such as node:console could still be required.
It's not a such big issue, but I already implement my own console object, so I don't want the script use the other.

zyxkad commented 10 months ago

Maybe we should just create a plain eventloop that only contains setTimeout such global functions:

https://github.com/dop251/goja_nodejs/pull/65#issuecomment-1788988207