Let's say we are creating a module called app by constructing a new vm.SourceTextModule object: const context = { exports: {}, console, // custo ...
Let's say we are creating a module called app by constructing a new vm.SourceTextModule object: const context = { exports: {}, console, // custo ...
I am trying to look at a possibility of having users add their own code within a Node app running an express server. Scenario - User clicks on save ...
Lately am building an API with Node.js that receives untrusted code to run it using vm2. The issue is I want to run async functions, so I need to use ...
I try to understand the following code as much as possible, because understanding it helps me a lot "use strict"; const {VM} = require('vm2'); const ...
I have some asynchronous JavaScript code, which I'd like to run using vm2 / NodeVM. The code tests two functions: a user-submitted function evenAndOd ...
I want to provide filesystem access for use with fs. How can I grant the vm2 process access to a specific directory? I've tried setting external to t ...
I am executing a JS script using vm module in browser like this with details below. setTimeout, setInterval and other interval built in methods do ...
I'm using a npm module called safe-eval to evaluate some JavaScript code i send to the backend. The code is usually a function that will be executed i ...
I am using worker_threads and vm2 to implement a serverless-like thing, but I cannot get a NodeVM instance in the main thread and then pass through wo ...
I am using the vm2 module, and I have some code with two functions: get_input() for getting some data that I have, and display() for showing some data ...
I am confused about the use cases of the VM module in NodeJS. After reading a little bit in the documentations about this module is just looks like a ...
I'm using the VM2 package to run user code. I'm trying to intercept console output and have set the NodeVM object's console property to 'redirect': ...
Suppose you have script A: defines a library with: And you have script B: reuses MathFunctions somehow: And you want to execute B in vm context, ...
I am running some sandboxed code in Node using vm2. The code being run will be mostly asynchronous. It is untrusted code, and can not be relied upon ...