+0
-1
| language: node_js | ||
| os: | ||
| - linux | ||
| - windows | ||
| - osx | ||
@@ -6,0 +5,0 @@ node_js: |
+6
-5
@@ -10,3 +10,4 @@ var fs = require('fs'); | ||
| packageJsonPath: './package.json', | ||
| includeDev: false | ||
| includeDev: false, | ||
| showWarnings: false | ||
| }; | ||
@@ -35,3 +36,3 @@ | ||
| override = overrides[key] || {}; | ||
| keys = keys.concat(getMainFiles(options.nodeModulesPath + "/" + key, override)); | ||
| keys = keys.concat(getMainFiles(options.nodeModulesPath + "/" + key, override, options.showWarnings)); | ||
| } | ||
@@ -42,3 +43,3 @@ | ||
| override = overrides[key] || {}; | ||
| keys = keys.concat(getMainFiles(options.nodeModulesPath + "/" + key, override)); | ||
| keys = keys.concat(getMainFiles(options.nodeModulesPath + "/" + key, override, options.showWarnings)); | ||
| } | ||
@@ -64,3 +65,3 @@ } | ||
| */ | ||
| function getMainFiles(modulePath, override) { | ||
| function getMainFiles(modulePath, override, showWarnings) { | ||
| var json; | ||
@@ -96,3 +97,3 @@ var files = []; | ||
| if (!files.length) { | ||
| if (showWarnings && !files.length) { | ||
| console.warn('npmfiles: No main files found for module ' + path.relative(`${process.cwd()}/node_modules`, modulePath)); | ||
@@ -99,0 +100,0 @@ } |
+1
-1
| { | ||
| "name": "npmfiles", | ||
| "version": "0.1.2", | ||
| "version": "0.1.3", | ||
| "description": "Get all main files for your project's NPM modules", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+7
-0
@@ -17,2 +17,3 @@ npmfiles | ||
| - [includeDev](#includedev) | ||
| - [showWarnings](#showwarnings) | ||
@@ -132,2 +133,8 @@ ## Inspiration | ||
| #### showWarnings | ||
| Type: `Boolean` Default: `false` | ||
| Set this option to `true` to show warnings for packages that don't have any files in the main entry or overrides | ||
| ## LICENSE | ||
@@ -134,0 +141,0 @@ |
10698
2.85%134
0.75%161
4.55%