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

require-in-the-middle

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-in-the-middle - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

12

index.js

@@ -16,8 +16,5 @@ 'use strict'

Module._load = function (request, parent, isMain) {
var filename = Module._resolveFilename(request, parent)
var cached = Module._cache[filename]
var exports = orig.apply(Module, arguments)
if (cached) return exports // abort if module is already cached by core
var filename = Module._resolveFilename(request, parent)
var native = filename.indexOf(path.sep) === -1

@@ -34,2 +31,3 @@ var name, basedir

// figure out if this is the main module file, or a file inside the module
var res = resolve.sync(name, { basedir: basedir })

@@ -39,10 +37,10 @@ if (res !== filename) return exports // abort if not main module file

if (patched[basedir || name]) return exports // abort if module have already been processed
patched[basedir || name] = true
// abort if module name isn't on whitelist
if (modules && modules.indexOf(name) === -1) return exports
if (patched[filename]) return exports // abort if module have already been processed
patched[filename] = true
return onrequire(exports, name, basedir)
}
}
{
"name": "require-in-the-middle",
"version": "1.0.0",
"version": "2.0.0",
"description": "Module to hook into the Node.js require function",

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

"coordinates": [
55.6665824,
12.5800815
55.6665852,
12.5800842
]
}
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