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

load

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

load - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 0.1.3
- Don't throw when we cannot delete the introduced globals.
## 0.1.2
- Fixes optional globals arg.
## 0.1.1

@@ -2,0 +8,0 @@ - Make it possible to add globals to the loaded script.

10

index.js

@@ -23,4 +23,4 @@ 'use strict';

globals["__filename"] = path.basename(location);
globals["__dirname"] = path.dirname(location);
globals.__filename = path.basename(location);
globals.__dirname = path.dirname(location);

@@ -63,3 +63,4 @@ return compiler(read(location), path.basename(location), globals);

if (context[global] === missing[global]) {
delete context[global];
try { delete context[global]; }
catch (e) {}
}

@@ -69,3 +70,4 @@ });

if (context[global] === globals[global]) {
delete context[global];
try { delete context[global]; }
catch (e) {}
}

@@ -72,0 +74,0 @@ });

2

package.json
{
"name": "load",
"version": "0.1.2",
"version": "0.1.3",
"description": "Load plain JavaScript files that don't use module patterns directly in node.",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -38,2 +38,7 @@ 'use strict';

}
}, {
it: 'doesnt throw when it wants to delete undefined variables',
does: function () {
load('./fixtures/globals.js', { undefined: undefined });
}
}].forEach(function compiling(test, index) {

@@ -40,0 +45,0 @@ console.log('('+ index +') it '+ test.it);

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