diff --git a/README.md b/README.md index cb9efec..6bf17f5 100644 --- a/README.md +++ b/README.md @@ -36,6 +36,8 @@ $ ./node_modules/.bin/license-to-fail init `warnOnUnknown`: instead of erroring on packages with an `UNKNOWN` license, just warn. (false by default) +`ignoreDevDependencies`: do not check licenses for devDependencies. (false by default) + ```js // ./config.js module.exports = { diff --git a/index.js b/index.js index fadcdc0..78d0273 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ module.exports = function checkLicenses(config) { var allowedPackages = config.allowedPackages || []; var warnOnUnknown = config.warnOnUnknown || false; var configPath = config.configPath; + var ignoreDevDependencies = config.ignoreDevDependencies || false; function log(dep) { var type = 'INDIRECT DEP'; @@ -47,7 +48,8 @@ module.exports = function checkLicenses(config) { } checker.init({ - start: process.cwd() + start: process.cwd(), + production: ignoreDevDependencies }, function(err, json) { var prohibitedDeps = Object.keys(json) .map(function(dep) {