We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8f53278 commit 237a5e0Copy full SHA for 237a5e0
README.md
@@ -24,9 +24,9 @@ vm2 is a sandbox that can run untrusted code with whitelisted Node's built-in mo
24
Try it yourself:
25
26
```js
27
-const vm = require('vm');
+import { runInNewContext } from "node:vm";
28
29
-vm.runInNewContext('this.constructor.constructor("return process")().exit()');
+runInNewContext('this.constructor.constructor("return process")().exit()');
30
console.log('Never gets executed.');
31
```
32
@@ -39,8 +39,6 @@ new VM().run('this.constructor.constructor("return process")().exit()');
39
40
## Installation
41
42
-**IMPORTANT**: VM2 requires Node.js 6 or newer.
43
-
44
```sh
45
npm install vm2
46
0 commit comments