- Mastering PhoneGap Mobile Application Development
- Kerri Shotts
- 342字
- 2021-07-16 13:03:51
Why use Gulp for task automation?
Gulp (http://gulpjs.com) is a task automation utility using the Node.js platform. Unlike some other task runners, one configures Gulp by writing a JavaScript code. The configuration for Gulp is just like any other JavaScript file, which means that if you know JavaScript, you can start defining the automation tasks quickly.
Gulp also uses the concept of streams (again, from Node.js). Although you can think of a stream as a file, streams are actually more powerful. Plugins can be inserted within steam processing to perform many different transformations, including beautification or uglification, transpilation (for example, ECMAScript 6 to ECMAScript 2015), concatenation, packaging, and much more.
Tip
If you've performed any sort of piping on the command line, Gulp should feel familiar to you, because it operates on a similar concept. The output from one process is piped to the next process, which performs any number of transformations, and so on, until the final output is written to another location.
Gulp also tries to run as many dependent tasks in parallel as possible. Ideally, this makes it possible to run Gulp tasks faster, although this really depends on how your tasks are structured. Other task runners such as Grunt perform their task steps in a sequence that may result in a slower output, although it may be easier to follow the steps from input to output when they're performed sequentially.
That's not to say that Gulp is the best task runner—there are many that are quite good, and you may find that you prefer one of them over Gulp. The skills you will learn in this book can easily be transferred to other task automation utilities.
Here are some other task runners that are useful:
- Grunt (http://www.gruntjs.com): The configuration is specified through settings, not code. The tasks are performed sequentially.
- Cake (http://coffeescript.org/documentation/docs/cake.html): It usesCoffeeScript and the configuration is specified via code, as it is seen in Gulp. If you like using CoffeeScript, you might prefer this over Gulp.
- Broccoli (https://github.com/broccolijs/broccoli): It also uses configuration through code.
- Java Web開發(fā)學(xué)習(xí)手冊
- Mastering SVG
- Learning Linux Binary Analysis
- SQL語言從入門到精通
- Mastering Unity Shaders and Effects
- SQL Server 2016數(shù)據(jù)庫應(yīng)用與開發(fā)習(xí)題解答與上機(jī)指導(dǎo)
- iOS編程基礎(chǔ):Swift、Xcode和Cocoa入門指南
- BeagleBone Black Cookbook
- Training Systems Using Python Statistical Modeling
- Android Studio開發(fā)實戰(zhàn):從零基礎(chǔ)到App上線 (移動開發(fā)叢書)
- 青少年學(xué)Python(第2冊)
- 實驗編程:PsychoPy從入門到精通
- PostgreSQL 12 High Availability Cookbook
- Learning iOS Penetration Testing
- INSTANT Apache Maven Starter