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

node-module-concat

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

node-module-concat - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

test_project/lib/func.js

3

lib/fileHeader.js
/********** Start module ${id}: ${path} **********/
__modules[${id}] = function() {
var exports = {}, module = {"exports": exports};
__modules[${id}] = function(module, exports) {

@@ -17,15 +17,15 @@ /* This header is placed at the beginning of the output file and defines the

if(!__moduleIsCached[uid]) {
// Populate the cache initially with an empty Object
__modulesCache[uid] = {};
// Populate the cache initially with an empty `exports` Object
__modulesCache[uid] = {"exports": {}, "loaded": false};
__moduleIsCached[uid] = true;
if(uid === 0) {
require.main = __modulesCache[uid];
}
/* Note: if this module requires itself, or if its depenedencies
require it, they will only see an empty Object for now */
// Now load the module
var module = __modules[uid]();
// Now copy the properties of the `module` into the module cache Object
for(var key in module) {
__modulesCache[uid][key] = module[key];
}
__modules[uid](__modulesCache[uid], __modulesCache[uid].exports);
__modulesCache[uid].loaded = true;
}
return __modulesCache[uid];
return __modulesCache[uid].exports;
}

@@ -32,0 +32,0 @@ /* This function is the replacement for all `__filename` references within a

{
"name": "node-module-concat",
"version": "1.2.0",
"version": "1.3.0",
"description": "Node.js module concatenation library",

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

var fs = require("fs")
, hello = require("./lib/hello")
, world = require("./lib/world");
, world = require("./lib/world")
, func = require("./lib/func");
console.log(hello.hello + ", " + world.world);
console.log(fs.readFileSync(__filename).toString() );
console.log(func() );
exports.hello = hello;
exports.world = world;
exports.func = func;
console.log("index printing world.func:", world.func);
if(require.main === module) {
console.log("index is main!");
} else {
console.log("index is **NOT** main!");
}
exports.hello = "Hello";
console.log(require("./world"))
exports.doneLoading = true;
if(require.main === module) {
console.log("hello module is main!!!!");
}
console.log("hello's filename is", __filename);
exports.world = "World";
exports.file = require("fs").readFileSync(__dirname + "/file.txt");
console.log("world printing hello", require("./hello"));
exports.func = require("./func");
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