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
Extending require() further #36
Comments
Somewhat relevant: I'm using a custom file system for user submitted code. Is there a way I can manually deal with local requires, like Update: Usage, would be something like this: NodeVM.file('/customfs/main.js', {
require: {
external: true,
root: '/customfs/', // restrict local requires to within the custom fs
},
customfs: {
getFileContents: (filename) => /* handle /customfs/ file read */,
exists: (filename) => /* ... */,
isDirectory: (filename) => /* ... */
}
}) |
@bartjoyce I need the same thing! Your link is broken, did you move it somewhere? |
@callumlocke I've since moved on to other projects and have stopped maintaining the code. The code I wrote is here: https://github.com/bartjoyce/vm2/ It's 30 commits behind, but at least you can see the modifications I've made. Important commit is this one: bmewj@302e910 I've made additional changes to vm2 that are not in my repo. If you want to see those too, let me know. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I would like an option which is a function that takes
vm2
'srequire
as an argument and returns a new function that should be used instead ofvm2
'srequire
.The text was updated successfully, but these errors were encountered: