simple-reload
Advanced tools
Comparing version
// Generated by CoffeeScript 1.9.3 | ||
(function() { | ||
var recursiveDelete; | ||
var fs, path, recursiveDelete; | ||
path = require("path"); | ||
fs = require("fs"); | ||
recursiveDelete = function(children) { | ||
@@ -21,6 +25,14 @@ var child, i, len; | ||
module.exports = function(name, deep) { | ||
var fullname; | ||
var dirname, fullname, stat; | ||
if (deep == null) { | ||
deep = false; | ||
} | ||
if (name[0] === '.') { | ||
dirname = module.parent.filename; | ||
stat = fs.statSync(dirname); | ||
if (stat.isFile()) { | ||
dirname = path.dirname(dirname); | ||
} | ||
name = path.resolve(dirname, name); | ||
} | ||
fullname = require.resolve(name); | ||
@@ -27,0 +39,0 @@ if (require.cache[fullname]) { |
{ | ||
"name": "simple-reload", | ||
"description": "deletes a package from cache and reloads it - zero dependencies", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"homepage": "https://github.com/paulpflug/", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -17,6 +17,6 @@ # simple-reload | ||
| Parameter | Usage | | ||
| --------: | :---------------------------------------| | ||
| name | name of the package you want to reload | | ||
| deep | if set, reloads all nested dependencies | | ||
| Parameter | Type | Usage | | ||
| --------: | ------- | :--------------------------------------| | ||
| name | string | name of the package you want to reload | | ||
| deep | boolean | if set, reloads all nested dependencies | | ||
@@ -33,3 +33,4 @@ ## Example | ||
- *v0.0.1*: First Release | ||
- *v0.0.2*: First bugfix | ||
- *v0.0.1*: First release | ||
@@ -36,0 +37,0 @@ ## License |
Sorry, the diff of this file is not supported yet
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
3485
20.46%42
31.25%38
2.7%3
50%