Comparing version 3.0.0 to 3.0.1
@@ -262,6 +262,6 @@ const {Script} = host.require('vm'); | ||
global.setTimeout = function(callback, ...args) { | ||
global.setTimeout = function(callback, delay, ...args) { | ||
let tmr = host.setTimeout(function() { | ||
callback.apply(null, args) | ||
}); | ||
}, delay); | ||
@@ -277,6 +277,6 @@ let local = { | ||
global.setInterval = function(callback, ...args) { | ||
global.setInterval = function(callback, interval, ...args) { | ||
let tmr = host.setInterval(function() { | ||
callback.apply(null, args) | ||
}); | ||
}, interval); | ||
@@ -283,0 +283,0 @@ let local = { |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"main": "index.js", | ||
@@ -19,0 +19,0 @@ "repository": { |
@@ -33,7 +33,26 @@ # vm2 [![NPM Version][npm-image]][npm-url] [![Package Quality][quality-image]][quality-url] [![Travis CI][travis-image]][travis-url] | ||
const {VM} = require('vm2'); | ||
const vm = new VM(); | ||
const vm = new VM(); | ||
vm.run("process.exit()"); | ||
vm.run(`process.exit()`); // TypeError: process.exit is not a function | ||
``` | ||
```javascript | ||
const {NodeVM} = require('vm2'); | ||
const vm = new NodeVM({ | ||
require: { | ||
external: true | ||
} | ||
}); | ||
vm.run(` | ||
var request = require('request'); | ||
request('http://www.google.com', function (error, response, body) { | ||
console.error(error); | ||
if (!error && response.statusCode == 200) { | ||
console.log(body) // Show the HTML for the Google homepage. | ||
} | ||
}) | ||
`, 'vm.js'); | ||
``` | ||
## Documentation | ||
@@ -45,3 +64,3 @@ | ||
* [CLI](#cli) | ||
* [2.x to 3.x changes](https://github.com/patriksimek/vm2/wiki/1.x-and-2.x-changes) | ||
* [2.x to 3.x changes](https://github.com/patriksimek/vm2/wiki/2.x-to-3.x-changes) | ||
* [1.x and 2.x docs](https://github.com/patriksimek/vm2/wiki/1.x-and-2.x-docs) | ||
@@ -48,0 +67,0 @@ * [Contributing](https://github.com/patriksimek/vm2/wiki/Contributing) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
64654
222
0