Gulp – Hello World

Gulp – Hello World

Let’s start a new node project in our folder and add a package.json by using command below:

1
npm init

Time to install gulp using npm. First globally to access the gulp command and then locally for our package.json .

1
2
npm install gulp -g
npm install gulp --save-dev

By default gulp looks for a gulpfile.js to run. Let’s create a simple gulpfile.js.

gulpfile.js
1
2
3
4
5
var gulp = require('gulp');

gulp.task('default', [], function() {
  console.log("Hellow World");
});

In your terminator run the gulp command below:

1
gulp

You should see:

1
2
3
4
5
6
Hello Gulp

Using gulpfile ~/YOUR_DIRECTORY/gulpfile.js
Starting 'default'...
Hello Gulp! You are mighty fine.
Finished 'default' after ...

Congratulations creating your first gulp build script. So far so good, That’s it!!! See ya!!! :)