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

require-inject

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

require-inject - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

6

index.js
"use strict";
var path = require("path")

@@ -10,2 +11,5 @@ module.exports = function (toLoad, mocks) {

if (/^[.][.]?\//.test(toLoad)) {
toLoad = path.resolve(path.dirname(module.parent.filename), toLoad)
}
var toLoadPath = require.resolve(toLoad)

@@ -16,3 +20,3 @@

// load our new version using our mocks
var mocked = require(toLoadPath)
var mocked = module.parent.require(toLoadPath)
// remove our version from the cache so anyone else gets the real thing

@@ -19,0 +23,0 @@ delete require.cache[toLoadPath]

2

package.json
{
"name": "require-inject",
"version": "1.0.2",
"version": "1.1.0",
"description": "A simple mock injector compatible needing no instrumentation in the libraries being tested",

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

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