Comparing version 0.3.0 to 0.4.0
@@ -54,2 +54,3 @@ 'use strict'; | ||
opts.depth = opts.depth || 1; | ||
opts.ignore = typeof opts.ignore == 'string' ? [opts.ignore] : opts.ignore || []; | ||
@@ -62,9 +63,9 @@ var dirs = nodeModulesPaths(opts.basedir) | ||
return zipmap(fs.readdirSync(dir).map(function (basename) { | ||
if (!validateModuleName(basename)) { | ||
var modulePath = path.resolve(dir, basename); | ||
var moduleName = getModuleName(modulePath); | ||
if (!validateModuleName(moduleName) || opts.ignore.indexOf(moduleName) >= 0) { | ||
return; | ||
} | ||
var modulePath = path.resolve(dir, basename); | ||
var moduleName = getModuleName(modulePath); | ||
var resolve = opts.skipFailures | ||
@@ -71,0 +72,0 @@ ? safeResolve.bind(null, |
{ | ||
"name": "acquire", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"description": "Require all modules from the node_modules directory, using Node module resolution algorithm to discover it", | ||
@@ -5,0 +5,0 @@ "author": "Eugene Sharygin <eush77@gmail.com>", |
@@ -33,2 +33,3 @@ [![npm](https://nodei.co/npm/acquire.png)](https://nodei.co/npm/acquire/) | ||
| depth | number | No | `1` | | ||
| ignore | string/[string] | No | `[]` | | ||
| skipFailures | boolean/function | No | `false` | | ||
@@ -38,2 +39,4 @@ | ||
`opts.ignore` specifies module names to ignore. | ||
If `opts.skipFailures` is `true`, modules that fail to `require()` (e.g. plugins for Grunt) are skipped. If `opts.skipFailures` is a function, it is called as `opts.skipFailures(moduleName, modulePath)` for each failure. | ||
@@ -40,0 +43,0 @@ |
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
6141
64
64