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 5.0.0 to 5.0.1

12

index.js

@@ -11,2 +11,4 @@ 'use strict'

const builtins = Module.builtinModules
// 'foo/bar.js' or 'foo/bar/index.js' => 'foo/bar'

@@ -43,3 +45,3 @@ const normalize = /([/\\]index)?(\.js)?$/

this._require = Module.prototype.require = function (request) {
this._require = Module.prototype.require = function (id) {
if (self._unhooked === true) {

@@ -53,7 +55,7 @@ // if the patched require function could not be removed because

const filename = Module._resolveFilename(request, this)
const core = filename.includes(path.sep) === false
const filename = Module._resolveFilename(id, this)
const core = builtins.includes(filename)
let moduleName, basedir
debug('processing %s module require(\'%s\'): %s', core === true ? 'core' : 'non-core', request, filename)
debug('processing %s module require(\'%s\'): %s', core === true ? 'core' : 'non-core', id, filename)

@@ -102,3 +104,3 @@ // return known patched modules immediately

debug('resolved filename to module: %s (request: %s, resolved: %s, basedir: %s)', moduleName, request, fullModuleName, basedir)
debug('resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)', moduleName, id, fullModuleName, basedir)

@@ -105,0 +107,0 @@ // Ex: require('foo/lib/../bar.js')

{
"name": "require-in-the-middle",
"version": "5.0.0",
"version": "5.0.1",
"description": "Module to hook into the Node.js require function",

@@ -15,3 +15,4 @@ "main": "index.js",

"roundround": "^0.2.0",
"standard": "^13.1.0",
"semver": "^6.3.0",
"standard": "^14.3.1",
"tape": "^4.11.0"

@@ -45,5 +46,5 @@ },

"coordinates": [
55.778265,
12.593155
55.776587,
12.592619
]
}
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