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 3.0.5 to 3.1.0

8

decache.js
var path = require('path'); // if module is locally defined we path.resolve it
var appDir = path.dirname(require.main.filename);
var find = require('find'); // https://www.npmjs.com/package/find

@@ -29,7 +28,8 @@

var mod;
if(moduleName.indexOf('.js') === -1) {
mod = moduleName + '\.js'; // append .js to file type
var ext = path.extname(moduleName);
if(ext === '') {
mod = moduleName + '\.js'; // append .js to file type by default
}
else {
mod = moduleName.replace('.js', '\.js'); // escape .js for regex
mod = moduleName.replace(ext, '\\' + ext); // escape extension for regex
}

@@ -36,0 +36,0 @@

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

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

@@ -56,2 +56,4 @@ # decache

Modules other than `.js`, like for example, `.jsx`, are supported as well.
If you have any questions or need more examples, please create a GitHub issue:

@@ -58,0 +60,0 @@ https://github.com/nelsonic/decache/issues

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