Comparing version 4.0.0 to 4.1.0
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 { |
{ | ||
"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'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9223
9
157
1
+ Addedcallsite@^1.0.0
+ Addedcallsite@1.0.0(transitive)