Fix module-not-found crash, changelog

This commit is contained in:
Tom MacWright 2015-05-06 15:57:48 -04:00
parent d5a8a03c8f
commit 89cba981da
4 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
## 1.1.0
* Add `external` option that allows the user to whitelist specific external
modules to be included in with documentation.
## 1.0.7
* Fixes sorting order of documentation

View File

@ -20,6 +20,9 @@ var mdeps = require('module-deps'),
* @name documentation
* @param {Array<String>|String} indexes files to process
* @param {Object} options options
* @param {Array<string>} options.external a string regex / glob match pattern
* that defines what external modules will be whitelisted and included in the
* generated documentation.
* @return {Object} stream of output
*/
module.exports = function (indexes, options) {

View File

@ -30,6 +30,8 @@ module.exports = {
// grab the path of the top-level node_modules directory.
var topNodeModules = path.join(path.dirname(index), 'node_modules');
return function matchGlob(file, pkg) {
// if a module is not found, don't include it.
if (!file || !pkg) return false;
// if package.json specifies a 'main' script, strip that path off
// the file to get the module's directory.
// otherwise, just use the dirname of the file.

View File

@ -1,2 +1,3 @@
require('external');
require('external2');
require('module-not-found');