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

decache

Package Overview
Dependencies
Maintainers
2
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decache - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

lib/mymodule/index.js

10

decache.js
var path = require('path'); // if module is locally defined we path.resolve it
var callsite = require('callsite');
require.find = function (moduleName) {
if (moduleName[0] === '.') {
moduleName = path.resolve(path.dirname(module.parent.filename), moduleName);
var stack = callsite();
for (var i in stack) {
var filename = stack[i].getFileName();
if (filename !== module.filename) {
moduleName = path.resolve(path.dirname(filename), moduleName);
break;
}
}
}

@@ -7,0 +15,0 @@ try {

7

package.json
{
"name": "decache",
"version": "4.0.0",
"version": "4.1.0",
"description": "decache (Delete Cache) lets you delete modules from node.js require() cache; useful when testing your modules/projects.",

@@ -40,3 +40,6 @@ "main": "decache.js",

"coverage"
]
],
"dependencies": {
"callsite": "^1.0.0"
}
}
// awesome tests here!
var test = require('tape'); // the reliable testing framework
var setup = require('../setup'); // ensure decache is pre-loaded
var decache = require('../decache.js');

@@ -4,0 +5,0 @@ var mymodule = require('../lib/mymodule');

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