diff --git a/index.js b/index.js
index 715bc1f..e9f56a2 100644
--- a/index.js
+++ b/index.js
@@ -14,13 +14,15 @@ module.exports = options => {
logger: fancyLog,
title: 'gulp-debug:',
minimal: true,
- showFiles: true
+ showFiles: true,
+ showCount: true
}, options);
if (process.argv.indexOf('--verbose') !== -1) {
options.verbose = true;
options.minimal = false;
options.showFiles = true;
+ options.showCount = true;
}
let count = 0;
@@ -43,7 +45,10 @@ module.exports = options => {
count++;
cb(null, file);
}, cb => {
- options.logger(options.title + ' ' + chalk.green(count + ' ' + plur('item', count)));
+ if (options.showCount) {
+ options.logger(options.title + ' ' + chalk.green(count + ' ' + plur('item', count)));
+ }
+
cb();
});
};
diff --git a/readme.md b/readme.md
index ca9f68b..0921840 100644
--- a/readme.md
+++ b/readme.md
@@ -55,7 +55,14 @@ The [`stat` property](http://nodejs.org/api/fs.html#fs_class_fs_stats) will be s
Type: `boolean`
Default: `true`
-Setting this to false will skip printing the file names and only show the file count.
+Print filenames.
+
+##### showCount
+
+Type: `boolean`
+Default: `true`
+
+Print the file count.
##### logger(message)
diff --git a/test.js b/test.js
index 245fea0..bd4dc28 100644
--- a/test.js
+++ b/test.js
@@ -88,7 +88,7 @@ test('output plural item count', async t => {
t.is(logInspect.lastMessage, 'unicorn: 2 items');
});
-test('not output file names when `showFiles` is false.', async t => {
+test('do not output file names when `showFiles` is false', async t => {
const stream = debug({
logger: logInspect.logger,
title: 'unicorn:',
@@ -114,3 +114,20 @@ test('using the default logger', async t => {
t.pass();
});
+
+test('do not output count when `showCount` is false', async t => {
+ const stream = debug({
+ logger: logInspect.logger,
+ title: 'unicorn:',
+ showCount: false
+ });
+ const finish = pEvent(stream, 'finish');
+
+ stream.write(file, () => {
+ stream.end(file);
+ });
+
+ await finish;
+
+ t.not(logInspect.lastMessage, 'unicorn: 1 item');
+});