Skip to content

Gulp

!gulp logo

What it is?

Gulp is a cross-platform, streaming task runner that lets developers automate many development tasks. At a high level, gulp reads files as streams and pipes the streams to different tasks. These tasks are code-based and use plugins. The tasks modify the files, building source files into production files.

Basically, you use Gulp to automate stuff that you would normally have to do manually, such as manually compiling Sass, manually optimizing images, manually refreshing your page in the browser, and so on.

Gulp requires Node, and its package manager, npm, which installs the gulp plugins.

How does it work?

A very big difference between Gulp and the other task runners out there is the way it handles file operations. Gulp will essentially pass a data stream from one plugin to the next without actually writing that stream in a temporary file between these tasks. That is called piping or streaming.

To give you an example, the Sass plugin will take a Sass or SCSS file and compile it into a CSS file. The Uglify plugin will take a normal JavaScript file and minify it.

So the thing with piping is that you can take a set of files and run them through a set of plugins or through one plugin. And you would get a different type of file in the end. You start with an SCSS file, and you end up with a CSS file.

Summary

  • Task runner
  • Build tool for JavaScript applications
  • Automate tasks
    • Minification
    • Unit testing
    • Linting
    • Compilation
    • Starting servers
    • Other file modifications

Read more - Gulp Quick Start