Introduction and Installation process of Gulp
Gulp differs from other task runners because it passes data stream from one plugin to another without creating a temporary file on the disk. The tasks return a modified stream of data. Gulp is a function-oriented framework with a direct Application Programming Interface that can modify data more efficiently and chain commands together. Furthermore, Gulp prefers code over configuration that makes tasks more manageable.
- Gulp Plugins are user friendly and perform one task at a time. The plugins can also be created by the programmer.
- Gulp is more efficient because it uses Node.js platform to enhance speed.
- It is easy to code and test web applications on it.
- Gulp plugins may not support features from underlying library if they get out of date.
- Documentation of Gulp plugin is not very robust and debugging a plugin can be a strenuous task.
Prerequisite for Installation :
1. Node.js should be installed in your system. The npm package manager must be installed while setting up Node.js.
2. Presence of any terminal application such as PowerShell, iTerm2, Bash Script etc, according to system requirements.
Installation Of Gulp :
- Step 1: Open the terminal application of your system. For sake of convenience, the screenshots attached in the article and run the below command. The -g indicates that Gulp will be installed globally in the system and can be accessed for any file.
$ sudo npm install gulp-cli -g
Note: Run as Administrator if it is being used in Windows. Mac does not offer the same option.
- Step 2: Create a project directory and navigate into that directory by using the following command.
$ npx mkdir intsall-project $ cd install-project
- Step 3: Enter the following command line in the opened directory. This line ensures that we have opened a npm based project directory. The attached image shows screen output after entering the command line. Now, a package name must be provided by the user in small letters. Here , the example package name entered is install-project.
$ npm init
“description”: “installation checking”,
“test”: “echo \”Error: no test specified\” && exit 1″
- Step 4: The following command will Install the gulp package in your devDependencies.
$ npm install --save-dev gulp
- Step 5: To check that Gulp is installed globally and locally you can run the following command.
$ gulp --version