gulp-print
Advanced tools
Comparing version 1.2.0 to 2.0.0
// Generated by CoffeeScript 1.10.0 | ||
var green, log, magenta, map, path, print, ref, | ||
slice = [].slice; | ||
var colors, green, log, magenta, map, path, print, ref; | ||
map = require('map-stream'); | ||
ref = require('colors'), green = ref.green, magenta = ref.magenta; | ||
path = require('path'); | ||
log = function() { | ||
var args, color, sig; | ||
color = arguments[0], args = 2 <= arguments.length ? slice.call(arguments, 1) : []; | ||
sig = color ? "[" + (green('gulp')) + "]" : "[gulp]"; | ||
args.unshift(sig); | ||
return console.log.apply(console, args); | ||
}; | ||
ref = require('gulp-util'), log = ref.log, colors = ref.colors; | ||
print = function(options) { | ||
var colors, format; | ||
if (options == null) { | ||
options = {}; | ||
} | ||
if (typeof options === 'function') { | ||
options = { | ||
format: options | ||
}; | ||
} | ||
format = options.format, colors = options.colors; | ||
if (colors == null) { | ||
colors = true; | ||
} | ||
green = colors.green, magenta = colors.magenta; | ||
print = function(format) { | ||
if (format == null) { | ||
@@ -40,9 +20,6 @@ format = function(filepath) { | ||
var filepath, formatted; | ||
filepath = path.relative(process.cwd(), file.path); | ||
if (colors !== false) { | ||
filepath = magenta(filepath); | ||
} | ||
filepath = magenta(path.relative(process.cwd(), file.path)); | ||
formatted = format(filepath); | ||
if (formatted) { | ||
print.log(colors, formatted); | ||
print.log(formatted); | ||
} | ||
@@ -49,0 +26,0 @@ return cb(null, file); |
{ | ||
"name": "gulp-print", | ||
"version": "1.2.0", | ||
"description": "Prints names of files to the console so that you can see what's in the pipe.", | ||
"version": "2.0.0", | ||
"description": "Prints names of files to the console so that you can see what's going through the the gulp pipe.", | ||
"keywords": [ | ||
"gulpplugin", | ||
"log", | ||
"print" | ||
"print", | ||
"debug", | ||
"status" | ||
], | ||
@@ -14,3 +16,2 @@ "homepage": "https://github.com/alexgorbatchev/gulp-print", | ||
"name": "Alex Gorbatchev", | ||
"email": "", | ||
"url": "https://github.com/alexgorbatchev" | ||
@@ -29,3 +30,3 @@ }, | ||
"map-stream": "~0.0.6", | ||
"colors": "^1.1.2" | ||
"gulp-util": "^3.0.6" | ||
}, | ||
@@ -38,3 +39,2 @@ "devDependencies": { | ||
"mocha": "^2.3.2", | ||
"gulp-util": "^3.0.6", | ||
"chai": "^3.2.0" | ||
@@ -41,0 +41,0 @@ }, |
@@ -44,17 +44,7 @@ # gulp-print | ||
If you want to turn colors off: | ||
```js | ||
gulp.task('print', function() { | ||
gulp.src('test/*.js') | ||
.pipe(print({colors: false})); | ||
}); | ||
``` | ||
## API | ||
### print(format or {format, colors}) | ||
### print(formatter) | ||
* `format` is a callback format function that passes in filepath to be printed. Callback should return a string which will be printed. | ||
* `colors` is a boolean which defaults to `true`. | ||
* `formatter` is a callback format function that passes in filepath to be printed. Callback should return a string which will be printed. | ||
@@ -61,0 +51,0 @@ ## Testing |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
6
7132
24
79
+ Addedgulp-util@^3.0.6
+ Addedansi-gray@0.1.1(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedansi-styles@2.2.1(transitive)
+ Addedansi-wrap@0.1.0(transitive)
+ Addedarray-differ@1.0.0(transitive)
+ Addedarray-uniq@1.0.3(transitive)
+ Addedbeeper@1.1.1(transitive)
+ Addedchalk@1.1.3(transitive)
+ Addedclone@1.0.4(transitive)
+ Addedclone-stats@0.0.1(transitive)
+ Addedcolor-support@1.1.3(transitive)
+ Addedcore-util-is@1.0.3(transitive)
+ Addeddateformat@2.2.0(transitive)
+ Addedduplexer2@0.0.2(transitive)
+ Addedescape-string-regexp@1.0.5(transitive)
+ Addedfancy-log@1.3.3(transitive)
+ Addedglogg@1.0.2(transitive)
+ Addedgulp-util@3.0.8(transitive)
+ Addedgulplog@1.0.0(transitive)
+ Addedhas-ansi@2.0.0(transitive)
+ Addedhas-gulplog@0.1.0(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedisarray@0.0.11.0.0(transitive)
+ Addedlodash._basecopy@3.0.1(transitive)
+ Addedlodash._basetostring@3.0.1(transitive)
+ Addedlodash._basevalues@3.0.0(transitive)
+ Addedlodash._getnative@3.9.1(transitive)
+ Addedlodash._isiterateecall@3.0.9(transitive)
+ Addedlodash._reescape@3.0.0(transitive)
+ Addedlodash._reevaluate@3.0.0(transitive)
+ Addedlodash._reinterpolate@3.0.0(transitive)
+ Addedlodash._root@3.0.1(transitive)
+ Addedlodash.escape@3.2.0(transitive)
+ Addedlodash.isarguments@3.1.0(transitive)
+ Addedlodash.isarray@3.0.4(transitive)
+ Addedlodash.keys@3.1.2(transitive)
+ Addedlodash.restparam@3.6.1(transitive)
+ Addedlodash.template@3.6.2(transitive)
+ Addedlodash.templatesettings@3.1.1(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmultipipe@0.1.2(transitive)
+ Addedobject-assign@3.0.0(transitive)
+ Addedparse-node-version@1.0.1(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedreadable-stream@1.1.142.3.8(transitive)
+ Addedreplace-ext@0.0.1(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsparkles@1.0.1(transitive)
+ Addedstring_decoder@0.10.311.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedsupports-color@2.0.0(transitive)
+ Addedthrough2@2.0.5(transitive)
+ Addedtime-stamp@1.1.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedvinyl@0.5.3(transitive)
+ Addedxtend@4.0.2(transitive)
- Removedcolors@^1.1.2
- Removedcolors@1.4.0(transitive)