Socket
Socket
Sign inDemoInstall

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.1 to 0.1.2

.travis.yml

12

index.js

@@ -17,10 +17,12 @@ 'use strict';

*/
function load(location) {
function load(location, globals) {
globals = globals || {};
if (!path.extname(location)) location = location +'.js';
location = path.resolve(path.dirname(module.parent.filename), location);
return compiler(read(location), path.basename(location), {
__filename: path.basename(location),
__dirname: path.dirname(location)
});
globals["__filename"] = path.basename(location);
globals["__dirname"] = path.dirname(location);
return compiler(read(location), path.basename(location), globals);
}

@@ -27,0 +29,0 @@

{
"name": "load",
"version": "0.1.1",
"description": "Load JavaScript files that do not use the bloat module patterns",
"version": "0.1.2",
"description": "Load plain JavaScript files that don't use module patterns directly in node.",
"main": "index.js",

@@ -26,4 +26,4 @@ "scripts": {

"devDependencies": {
"pre-commit": "0.0.4"
"pre-commit": "0.0.x"
}
}
# load
[![Build Status](https://travis-ci.org/3rd-Eden/load.png)](https://travis-ci.org/3rd-Eden/load)
[![NPM version](https://badge.fury.io/js/load.png)](http://badge.fury.io/js/load)
Because fuck dedicated module patterns, module loaders, compilers and other kind

@@ -4,0 +7,0 @@ of pointless code bloat that requires me to wrap my client-side JavaScript for

@@ -22,2 +22,8 @@ 'use strict';

}, {
it: 'passes optional argument globals to file scope',
does: function does() {
var lib = load('./fixtures/file3', {foo: 'bar'});
assert.equal(lib.getFoo(), 'bar');
}
}, {
it: 'adds nodejs globals to the code.',

@@ -24,0 +30,0 @@ does: function () {

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