diff options
Diffstat (limited to 'node_modules/gulp-util/README.md')
-rw-r--r-- | node_modules/gulp-util/README.md | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/node_modules/gulp-util/README.md b/node_modules/gulp-util/README.md index a8d9b19ef..65209b57f 100644 --- a/node_modules/gulp-util/README.md +++ b/node_modules/gulp-util/README.md @@ -12,7 +12,7 @@ </tr> <tr> <td>Node Version</td> -<td>>= 0.9</td> +<td>>= 0.10</td> </tr> </table> @@ -21,8 +21,7 @@ ```javascript var gutil = require('gulp-util'); -gutil.log('stuff happened', 'Really it did', gutil.colors.cyan('123')); -gutil.beep(); +gutil.log('stuff happened', 'Really it did', gutil.colors.magenta('123')); gutil.replaceExtension('file.coffee', '.js'); // file.js @@ -35,13 +34,18 @@ gutil.template('test <%= name %> <%= file.path %>', opt) // test todd /js/hi.js ### log(msg...) -Logs stuff. Already prefixed with [gulp] and all that. Use the right colors for values. If you pass in multiple arguments it will join them by a space. +Logs stuff. Already prefixed with [gulp] and all that. If you pass in multiple arguments it will join them by a space. +The default gulp coloring using gutil.colors.<color>: ``` -values (files, module names, etc.) = magenta -numbers (times, counts, etc) = cyan +values (files, module names, etc.) = cyan +numbers (times, counts, etc) = magenta ``` +### colors + +Is an instance of [chalk](https://github.com/sindresorhus/chalk). + ### replaceExtension(path, newExtension) Replaces a file extension in a path. Returns the new path. @@ -64,9 +68,9 @@ This is just [vinyl](https://github.com/wearefractal/vinyl) ```javascript var file = new gutil.File({ - base: join(__dirname, './fixtures/'), + base: path.join(__dirname, './fixtures/'), cwd: __dirname, - path: join(__dirname, './fixtures/test.coffee') + path: path.join(__dirname, './fixtures/test.coffee') }); ``` @@ -81,7 +85,7 @@ gulp.task('scripts', function() { gulp.src('src/**/*.js') .pipe(concat('script.js')) .pipe(gutil.env.type === 'production' ? uglify() : gutil.noop()) - .pipe(gulp.dest('dist/'); + .pipe(gulp.dest('dist/')); }); ``` @@ -97,9 +101,9 @@ Callback is optional and receives two arguments: error and data ```javascript gulp.src('stuff/*.js') - .pipe(gutil.buffer(function(err, files){ + .pipe(gutil.buffer(function(err, files) { - }); + })); ``` ## new PluginError(pluginName, message[, options]) @@ -109,6 +113,7 @@ gulp.src('stuff/*.js') - By default the stack will not be shown. Set `options.showStack` to true if you think the stack is important for your error. - If you pass an error in as the message the stack will be pulled from that, otherwise one will be created. - Note that if you pass in a custom stack string you need to include the message along with that. +- Error properties will be included in `err.toString()`. Can be omitted by including `{showProperties: false}` in the options. These are all acceptable forms of instantiation: @@ -130,11 +135,11 @@ var existingError = new Error('OMG'); var err = new gutil.PluginError('test', existingError, {showStack: true}); ``` -[npm-url]: https://npmjs.org/package/gulp-util +[npm-url]: https://www.npmjs.com/package/gulp-util [npm-image]: https://badge.fury.io/js/gulp-util.svg [travis-url]: https://travis-ci.org/gulpjs/gulp-util -[travis-image]: https://travis-ci.org/gulpjs/gulp-util.svg?branch=master +[travis-image]: https://img.shields.io/travis/gulpjs/gulp-util.svg?branch=master [coveralls-url]: https://coveralls.io/r/gulpjs/gulp-util -[coveralls-image]: https://coveralls.io/repos/gulpjs/gulp-util/badge.png +[coveralls-image]: https://img.shields.io/coveralls/gulpjs/gulp-util.svg [depstat-url]: https://david-dm.org/gulpjs/gulp-util [depstat-image]: https://david-dm.org/gulpjs/gulp-util.svg |