Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vm2

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vm2 - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

10

lib/sandbox.js

@@ -21,3 +21,3 @@ // Generated by CoffeeScript 1.10.0

'use strict';
var EXTENSIONS, _prepareRequire, _requireNative, _resolveFilename, fs, global, pa;
var EXTENSIONS, _prepareRequire, _requireNative, _resolveFilename, fs, global, pa, ref;
EXTENSIONS = {

@@ -396,5 +396,7 @@ ".json": function(module, filename) {

}
global.Buffer = _requireNative('buffer').Buffer;
fs = _requireNative('fs');
pa = _requireNative('path');
if (vm.options.require && ((ref = vm.options.requireNative) != null ? ref['buffer'] : void 0) === true) {
global.Buffer = _requireNative('buffer').Buffer;
}
fs = parent.require('fs');
pa = parent.require('path');

@@ -401,0 +403,0 @@ /*

2

package.json

@@ -16,3 +16,3 @@ {

],
"version": "1.0.1",
"version": "2.0.0",
"main": "index.js",

@@ -19,0 +19,0 @@ "repository": {

@@ -37,2 +37,15 @@ # vm2 [![Dependency Status](https://david-dm.org/patriksimek/vm2.png)](https://david-dm.org/patriksimek/vm2) [![NPM version](https://badge.fury.io/js/vm2.png)](http://badge.fury.io/js/vm2) [![Build Status](https://secure.travis-ci.org/patriksimek/vm2.png)](http://travis-ci.org/patriksimek/vm2)

## Documentation
* [1.x to 2.x changes](#1-x-to-2-x-changes)
* [VM](#vm)
* [NodeVM](#nodevm)
* [Calling VM's methods](#calling-vms-methods)
* [CLI](#cli)
* [Known Issues](#known-issues)
## 1.x to 2.x changes
`Buffer` class is no longer globally available by default in NodeVM. To make `Buffer` accessible globaly, enable `require` option and make sure `buffer` module is whitelisted. More info in [Known Issues](#known-issues).
## VM

@@ -133,2 +146,6 @@

## Known Issues
Allowing `buffer` to be required inside NodeVM may crash your app with `TypeError: Invalid non-string/buffer chunk` errors (reported [here](https://github.com/patriksimek/vm2/issues/22) and [here](https://github.com/patriksimek/vm2/issues/7)). To prevent `buffer` from loading, disable `require` option or remove `buffer` from list of whitelisted native modules. Keep in mind that modules like `fs` or `stream` do require `buffer` internally.
<a name="license" />

@@ -135,0 +152,0 @@ ## License

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc