UNPKG

2.71 kBMarkdownView Raw
1# gulp-print
2
3[![NPM downloads](https://img.shields.io/npm/dt/gulp-print.svg)](https://npmjs.org/package/gulp-print)
4[![GitTip](http://img.shields.io/gittip/alexgorbatchev.svg)](https://gittip.com/alexgorbatchev)
5[![Dependency status](https://img.shields.io/david/alexgorbatchev/gulp-print.svg)](https://david-dm.org/alexgorbatchev/gulp-print)
6[![devDependency Status](https://img.shields.io/david/dev/alexgorbatchev/gulp-print.svg)](https://david-dm.org/alexgorbatchev/gulp-print#info=devDependencies)
7[![Build Status](https://img.shields.io/travis/alexgorbatchev/gulp-print.svg)](https://travis-ci.org/alexgorbatchev/gulp-print)
8
9This is a very basic [gulp](http://gulpjs.com) plugin that prints names of files. It's useful as a debugging tool to see which files are moving through the pipe or as a status printout.
10
11## Installation
12
13```sh
14npm install gulp-print
15```
16
17## Usage Example
18
19```js
20// CommonJS
21const gulp = require('gulp');
22const print = require('gulp-print').default;
23
24// ... or ES modules
25import * as gulp from 'gulp';
26import print from 'gulp-print';
27
28gulp.task('print', () => {
29 gulp.src('test/*.js')
30 .pipe(print())
31});
32
33// ... or using custom formatter:
34
35gulp.task('print', () => {
36 gulp.src('test/*.js')
37 .pipe(print(filepath => `built: ${filepath}`))
38});
39
40// ... change log function
41import { setLogFunction } from 'gulp-print';
42
43setLogFunction(message => console.log('LOG', message));
44```
45
46## API
47
48### print(formatter)
49
50* `formatter` is a callback format function that passes in filepath to be printed. Callback should return a string which will be printed.
51
52## Testing
53
54```sh
55npm test
56```
57
58## License
59
60The MIT License (MIT)
61
62Copyright 2014 Alex Gorbatchev
63
64Permission is hereby granted, free of charge, to any person obtaining a copy
65of this software and associated documentation files (the "Software"), to deal
66in the Software without restriction, including without limitation the rights
67to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
68copies of the Software, and to permit persons to whom the Software is
69furnished to do so, subject to the following conditions:
70
71The above copyright notice and this permission notice shall be included in
72all copies or substantial portions of the Software.
73
74THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
75IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
76FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
77AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
78LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
79OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
80THE SOFTWARE.