include-all
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -262,21 +262,7 @@ /** | ||
// If `force: true` was set, remove the module from the require() | ||
// cache, along with any modules that the module `required()` | ||
// If `force: true` was set, wipe out the previous contents from | ||
// this spot in the require cache before proceeding. | ||
if (options.force) { | ||
var resolved = require.resolve(filepath); | ||
// First, see if the item is actually cached. | ||
if (require.cache[resolved]) { | ||
// If so, add it to a stack of modules to remove. | ||
var modulesToRemove = [require.cache[resolved]]; | ||
// While there are items in the stack... | ||
while (modulesToRemove.length) { | ||
// Pop a module off the stack. | ||
var moduleToRemove = modulesToRemove.pop(); | ||
// Add its children to the stack. | ||
var children = (require.cache[moduleToRemove.id] && require.cache[moduleToRemove.id].children) || []; | ||
modulesToRemove = modulesToRemove.concat(children); | ||
// Delete the module from the cache. | ||
delete require.cache[moduleToRemove.id]; | ||
} | ||
} | ||
if (require.cache[resolved]) { delete require.cache[resolved]; } | ||
} | ||
@@ -283,0 +269,0 @@ |
{ | ||
"name": "include-all", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "An easy way to include all node.js modules within a directory.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -326,4 +326,29 @@ # include-all | ||
## Help | ||
First, please read through the documentation above. If you have further questions or are having trouble, click [here](http://sailsjs.com/support). | ||
## Bugs [![NPM version](https://badge.fury.io/js/include-all.svg)](http://npmjs.com/package/include-all) | ||
To report a bug, [click here](http://sailsjs.com/bugs). | ||
## Contributing | ||
Please observe the guidelines and conventions laid out in the [Sails project contribution guide](http://sailsjs.com/contribute) when opening issues or submitting pull requests. | ||
[![NPM](https://nodei.co/npm/include-all.png?downloads=true)](http://npmjs.com/package/include-all) | ||
## License | ||
MIT | ||
Copyright © 2011 [Felix Geisendörfer](http://github.com/felixge) | ||
Copyright © 2012 [Mike McNeil](http://github.com/mikermcneil) | ||
_A core module in the Sails framework since 2012._ | ||
The [Sails framework](http://sailsjs.com) is free and open-source under the [MIT License](http://sailsjs.com/license). | ||
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
33917
8
354
479