For those newbies developers who have passion in venturing into the world of scripting, then tool-kits like Gulp will be of great help to you when it comes to achieving success in the front end development of your applications.Gulp .js is cross platform service which can be readily integrated in all IDEs.
In this tutorial, am going to take you through a step by step guide on how you can install gulp.js on windows operating system.But first , what is gulp.js?Gulp.js is a command line which utilizes node.js to run and can be installed using npm. The core function of this gulp java script file is to manage automated tasks and run repetitive processes during development of web system applications.
Gulp.js being a unique tasker has a behavior of employing the use of node streams and also piping outputs from one task to the other.Gulp js can read files once and then process them into different tasks.This is important as it leads to a faster performance when building processes of files starts.The other functions which gulp js carries are the automatic reloading of web servers and optimizing web assets.
Now lets install gulp.Js on our computers and then after that we will create our first gulp file.First, download and install node .js from their official site.Choose the LTS version as shown below.
To check if node .js and npm have installed correctly in your pc, go to your terminal or command and type node -v and npm -v as shown below.
If your node.js has not installed correctly, try rebooting reinstalling it or rebooting the PC.Then after that, type npm install -g gulp in your terminal.The -g means the gulp will install globally on your pc as shown below here.Also, make sure your are working in your projects root folder before running this command or else your gulp.js modules will be installed on wrong directory
To check if your gulp has installed correctly, type gulp on your terminal and if it not available it should show you that no gulp file found has shown here below.
Creating a "hello-world" using gulp.js
Now, lets create our first gulp file .We will execute a hello world task using gulp . When we run the code below , we will be telling our gulp toolkit to execute the "hello world" task which is inside our gulp.js file. Now , go to command line and try executing this code below here;
- var gulp = require('gulp');
- gulp.task('hello-world', function(){
- console.log('hello world');
- });
Our gulp.js file will need a require function which will used for adding references to the node modules which we had installed earlier. After referencing our file using require function, we can use in creating our tasks.The code above is simply writing to the console window informing it to display hello-world . You can use it automate several tasks.
If you have any problem in installing gulp and creating your first gulp file, dont hesitate in getting back to me and i will be of great help to you.Enjoy and share widely with your friends.
Wonderful post!!Thank you for sharing this info with us.
ReplyDeleteKeep updating I would like to know more updates on this topic
Very useful content, I would like to suggest this blog to my friends.
Web Designing Course in Chennai
web designing course
I read the post and I have really enjoyed your blogs posts. Looking for the next post.
ReplyDeleteAviation Academy in Chennai
Air hostess training in Chennai
Airport management courses in Chennai
Ground staff training in Chennai
Medical coding training in Chennai
Fashion designing courses in Chennai
Interior design courses in Chennai