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

recursive-uncache

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

recursive-uncache - npm Package Compare versions

Comparing version 0.0.1 to 0.1.0

4

package.json
{
"name": "recursive-uncache",
"description": "recursively uncache required files",
"version": "0.0.1",
"version": "0.1.0",
"homepage": "https://github.com/paulpflug/",

@@ -24,3 +24,3 @@ "author": {

"devDependencies": {
"coffee-script": "^1.12.4"
"coffeescript": "^2.0.0-alpha1"
},

@@ -27,0 +27,0 @@ "keywords": [

@@ -19,3 +19,3 @@ # recursive-uncache

uncache(module,base=".") // module must be a absolute path
uncache(module,base=".",verbose=false) // module must be a absolute path
// example with chokidar

@@ -22,0 +22,0 @@ chokidar.watch(["./src"],{ignoreInitial: true})

(function() {
module.exports = function(filepath, base) {
module.exports = function(filepath, base = ".", verbose) {
var id, mod, ref, results;
if (base == null) {
base = ".";
}
if ((mod = require.cache[filepath]) != null) {
delete require.cache[filepath];
console.log("deleted cache for " + filepath);
if (verbose) {
console.log(`deleted cache for ${filepath}`);
}
results = [];
while ((id = (ref = mod.parent) != null ? ref.id : void 0) !== base) {
delete require.cache[id];
console.log("deleted cache for " + id);
if (verbose) {
console.log(`deleted cache for ${id}`);
}
results.push(mod = mod.parent);

@@ -15,0 +16,0 @@ }

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