Initial commit
[yaffs-website] / node_modules / gulp / README.md
1 <p align="center">
2   <a href="http://gulpjs.com">
3     <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
4   </a>
5   <p align="center">The streaming build system</p>
6 </p>
7
8 [![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]
9
10 ## What is gulp?
11
12 - **Automation** - gulp is a toolkit that helps you automate painful or time-consuming tasks in your development workflow.
13 - **Platform-agnostic** - Integrations are built into all major IDEs and people are using gulp with PHP, .NET, Node.js, Java, and other platforms.
14 - **Strong Ecosystem** - Use npm modules to do anything you want + over 2000 curated plugins for streaming file transformations
15 - **Simple** - By providing only a minimal API surface, gulp is easy to learn and simple to use
16
17 ## Documentation
18
19 For a Getting started guide, API docs, recipes, making a plugin, etc. check out or docs!
20
21 - Need something reliable? Check out the [documentation for the current release](/docs/README.md)!
22 - Want to help us test the latest and greatest? Check out the [documentation for the next release](https://github.com/gulpjs/gulp/tree/4.0)!
23
24 ## Sample `gulpfile.js`
25
26 This file will give you a taste of what gulp does.
27
28 ```js
29 var gulp = require('gulp');
30 var coffee = require('gulp-coffee');
31 var concat = require('gulp-concat');
32 var uglify = require('gulp-uglify');
33 var imagemin = require('gulp-imagemin');
34 var sourcemaps = require('gulp-sourcemaps');
35 var del = require('del');
36
37 var paths = {
38   scripts: ['client/js/**/*.coffee', '!client/external/**/*.coffee'],
39   images: 'client/img/**/*'
40 };
41
42 // Not all tasks need to use streams
43 // A gulpfile is just another node program and you can use any package available on npm
44 gulp.task('clean', function() {
45   // You can use multiple globbing patterns as you would with `gulp.src`
46   return del(['build']);
47 });
48
49 gulp.task('scripts', ['clean'], function() {
50   // Minify and copy all JavaScript (except vendor scripts)
51   // with sourcemaps all the way down
52   return gulp.src(paths.scripts)
53     .pipe(sourcemaps.init())
54       .pipe(coffee())
55       .pipe(uglify())
56       .pipe(concat('all.min.js'))
57     .pipe(sourcemaps.write())
58     .pipe(gulp.dest('build/js'));
59 });
60
61 // Copy all static images
62 gulp.task('images', ['clean'], function() {
63   return gulp.src(paths.images)
64     // Pass in options to the task
65     .pipe(imagemin({optimizationLevel: 5}))
66     .pipe(gulp.dest('build/img'));
67 });
68
69 // Rerun the task when a file changes
70 gulp.task('watch', function() {
71   gulp.watch(paths.scripts, ['scripts']);
72   gulp.watch(paths.images, ['images']);
73 });
74
75 // The default task (called when you run `gulp` from cli)
76 gulp.task('default', ['watch', 'scripts', 'images']);
77 ```
78
79 ## Incremental Builds
80
81 We recommend these plugins:
82
83 - [gulp-changed](https://github.com/sindresorhus/gulp-changed) - only pass through changed files
84 - [gulp-cached](https://github.com/contra/gulp-cached) - in-memory file cache, not for operation on sets of files
85 - [gulp-remember](https://github.com/ahaurw01/gulp-remember) - pairs nicely with gulp-cached
86 - [gulp-newer](https://github.com/tschaub/gulp-newer) - pass through newer source files only, supports many:1 source:dest
87
88 ## Want to contribute?
89
90 Anyone can help make this project better - check out our [Contributing guide](/CONTRIBUTING.md)!
91
92 [downloads-image]: https://img.shields.io/npm/dm/gulp.svg
93 [npm-url]: https://www.npmjs.com/package/gulp
94 [npm-image]: https://img.shields.io/npm/v/gulp.svg
95
96 [travis-url]: https://travis-ci.org/gulpjs/gulp
97 [travis-image]: https://img.shields.io/travis/gulpjs/gulp.svg
98
99 [coveralls-url]: https://coveralls.io/r/gulpjs/gulp
100 [coveralls-image]: https://img.shields.io/coveralls/gulpjs/gulp/master.svg
101
102 [gitter-url]: https://gitter.im/gulpjs/gulp
103 [gitter-image]: https://badges.gitter.im/gulpjs/gulp.png