diff options
Diffstat (limited to 'node_modules/gulp-debug')
-rw-r--r-- | node_modules/gulp-debug/index.js | 57 | ||||
-rw-r--r-- | node_modules/gulp-debug/package.json | 16 | ||||
-rw-r--r-- | node_modules/gulp-debug/readme.md | 33 |
3 files changed, 58 insertions, 48 deletions
diff --git a/node_modules/gulp-debug/index.js b/node_modules/gulp-debug/index.js index 94623fd1c..ce720ab38 100644 --- a/node_modules/gulp-debug/index.js +++ b/node_modules/gulp-debug/index.js @@ -1,44 +1,47 @@ 'use strict'; -var path = require('path'); -var gutil = require('gulp-util'); -var through = require('through2'); -var tildify = require('tildify'); -var stringifyObject = require('stringify-object'); -var chalk = require('chalk'); -var objectAssign = require('object-assign'); -var plur = require('plur'); -var prop = chalk.blue; - -module.exports = function (opts) { - opts = objectAssign({ +const path = require('path'); +const gutil = require('gulp-util'); +const through = require('through2'); +const tildify = require('tildify'); +const stringifyObject = require('stringify-object'); +const chalk = require('chalk'); +const plur = require('plur'); + +const prop = chalk.blue; + +module.exports = opts => { + opts = Object.assign({ title: 'gulp-debug:', - minimal: true + minimal: true, + showFiles: true }, opts); if (process.argv.indexOf('--verbose') !== -1) { opts.verbose = true; opts.minimal = false; + opts.showFiles = true; } - var count = 0; + let count = 0; - return through.obj(function (file, enc, cb) { - var full = - '\n' + - (file.cwd ? 'cwd: ' + prop(tildify(file.cwd)) : '') + - (file.base ? '\nbase: ' + prop(tildify(file.base)) : '') + - (file.path ? '\npath: ' + prop(tildify(file.path)) : '') + - (file.stat && opts.verbose ? '\nstat:' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trimRight()) : '') + - '\n'; + return through.obj((file, enc, cb) => { + if (opts.showFiles) { + const full = + '\n' + + (file.cwd ? 'cwd: ' + prop(tildify(file.cwd)) : '') + + (file.base ? '\nbase: ' + prop(tildify(file.base)) : '') + + (file.path ? '\npath: ' + prop(tildify(file.path)) : '') + + (file.stat && opts.verbose ? '\nstat: ' + prop(stringifyObject(file.stat, {indent: ' '}).replace(/[{}]/g, '').trim()) : '') + + '\n'; - var output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full; + const output = opts.minimal ? prop(path.relative(process.cwd(), file.path)) : full; - count++; - - gutil.log(opts.title + ' ' + output); + gutil.log(opts.title + ' ' + output); + } + count++; cb(null, file); - }, function (cb) { + }, cb => { gutil.log(opts.title + ' ' + chalk.green(count + ' ' + plur('item', count))); cb(); }); diff --git a/node_modules/gulp-debug/package.json b/node_modules/gulp-debug/package.json index 76d7f2d64..462857670 100644 --- a/node_modules/gulp-debug/package.json +++ b/node_modules/gulp-debug/package.json @@ -1,19 +1,19 @@ { "name": "gulp-debug", - "version": "2.1.2", - "description": "Debug vinyl file streams to see what files are run through your gulp pipeline", + "version": "3.1.0", + "description": "Debug Vinyl file streams to see what files are run through your Gulp pipeline", "license": "MIT", "repository": "sindresorhus/gulp-debug", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", - "url": "http://sindresorhus.com" + "url": "sindresorhus.com" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "scripts": { - "test": "mocha" + "test": "xo && mocha" }, "files": [ "index.js" @@ -33,9 +33,8 @@ "dependencies": { "chalk": "^1.0.0", "gulp-util": "^3.0.0", - "object-assign": "^4.0.1", "plur": "^2.0.0", - "stringify-object": "^2.3.0", + "stringify-object": "^3.0.0", "through2": "^2.0.0", "tildify": "^1.1.2" }, @@ -44,6 +43,7 @@ "mocha": "*", "proxyquire": "^1.0.1", "sinon": "^1.9.1", - "strip-ansi": "^3.0.0" + "strip-ansi": "^3.0.0", + "xo": "*" } } diff --git a/node_modules/gulp-debug/readme.md b/node_modules/gulp-debug/readme.md index ff1206367..5c3b98061 100644 --- a/node_modules/gulp-debug/readme.md +++ b/node_modules/gulp-debug/readme.md @@ -1,8 +1,8 @@ # gulp-debug [![Build Status](https://travis-ci.org/sindresorhus/gulp-debug.svg?branch=master)](https://travis-ci.org/sindresorhus/gulp-debug) -> Debug [vinyl](https://github.com/wearefractal/vinyl) file streams to see what files are run through your gulp pipeline +> Debug [Vinyl](https://github.com/gulpjs/vinyl) file streams to see what files are run through your Gulp pipeline -![](screenshot.png) +<img src="screenshot.png" width="415"> ## Install @@ -15,40 +15,47 @@ $ npm install --save-dev gulp-debug ## Usage ```js -var gulp = require('gulp'); -var debug = require('gulp-debug'); +const gulp = require('gulp'); +const debug = require('gulp-debug'); -gulp.task('default', function () { - return gulp.src('foo.js') +gulp.task('default', () => + gulp.src('foo.js') .pipe(debug({title: 'unicorn:'})) - .pipe(gulp.dest('dist')); -}); + .pipe(gulp.dest('dist')) +); ``` ## API -### debug(options) +### debug([options]) #### options ##### title -Type: `string` -Default: `'gulp-debug:'` +Type: `string`<br> +Default: `gulp-debug:` Give it a custom title so it's possible to distinguish the output of multiple instances logging at once. ##### minimal -Type: `boolean` +Type: `boolean`<br> Default: `true` By default only relative paths are shown. Turn off minimal mode to also show `cwd`, `base`, `path`. The [`stat` property](http://nodejs.org/api/fs.html#fs_class_fs_stats) will be shown when you run gulp in verbose mode: `gulp --verbose`. +##### showFiles + +Type: `boolean`<br> +Default: `true` + +Setting this to false will skip printing the file names and only show the file count. + ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) |