All Task Runners in One Gulp
Understanding Gulp Task Runner
What is a task-runner? It is an app, which does routine small tasks in an automatic mode. What you need to do is type the command in your terminal. Gulp js being a built framework gives you the tools to create tasks that fit your specific needs. This tool is especially popular among our PHP developers, since it helps them to save time a lot and is currently used on almost every large project we do for our clients.
What Can Be Done with the Help of Gulp JS in a Quick and Smart Way?
This task runner has extensive functionality including:
- automatic tests
- files concatenation and minimization
- images optimization and other.
What Makes Gulp Build System Different?
Why Gulp is better than other ones? Gulp build system offers such advantages:
- more compact and readable instructions being not a configuration file but idiomatic “the node way” code
- plugins are very simple and do only one thing, which is described on official website
- tasks are running in maximum concurrency
- I/O works the way you plan without creation of additional temporary files and directories.
Such good performance is impossible without built-in virtual filesystem (VFS, streams and basic task system). Gulp task runner has a great interface for working with streaming data and with the help of node’s streams file manipulation all processes are performed in memory, and a file isn’t written until you tell it to do so. And don’t forget that if you are interested in optimizing your work even more, you should choose the proper project management tool for your team.
Gulp App Basic File System
Gulp app has basic file system including only 5 functions:
- gulp.task(name, fn) – registers function with a name. Also we can pass dependencies if other tasks need to run first
- gulp.run(tasks) – runs all tasks in maximum concurrency
- gulp.watch(glob, fn) – runs function when a file matched the glob is changed
- gulp.src(glob) – returns readable stream
- gulp.dest(folder) – this returns a writable stream. File objects piped to this are saved to file system
Although the project is considered as rather young one it proved to have great potential in comparison to GruntJS. According to Oomphinc.com, Gulp has such Pros in comparison to GruntJS:
Being a young project it lacks documentation and number of plugins is much smaller than Grunt’s. Still comparing November 2015 when its number was 1916 and nowadays 2757 we should admin that project is rapidly developing. Still there is a tendency that Gulp is being used in small projects, as well as Grunt is more common having huge community.
What’s Your Best Built System?
As any kind of project Gulp has its own pros and cons. Still being a rapidly growing task runner, Gulp is a breath of fresh air for developers. It proves to be a handy tool in modern environment for front end development helping doing tasks fast, efficient and convenient.