SlideShare une entreprise Scribd logo
1  sur  29
Introduction to
Gulp
Arga Padan
David Hutagalung
What’s
Gulp
• Front-end
development tool
• Task automation in
JavaScript
• Streaming build
system
Why
Gulp
• Demand on
large projects
• Repetitive,
tedious tasks
• Saving time
Getting
started
More
technically..
❶ from command line…
$ npm install -g gulp
(install Gulp globally)
❷ create
gulpfile.js & package.json
(on your project folder.
See at slide 13-15 for
more details)
❸ from command line..
$ npm install [plugin_name]
--save (project folder)
More technically..
(cont.)
gulpfile.js
Tells Gulp for every tasks,
what those tasks are,
when to run them.
package.json
List of installed plugins
Create both of them at root
directory
API • task
• src
• pipe
• dest
• watch
API
task
defining a task
gulp.task(name[, deps], fn)
name → task name
deps → arrays of tasks
(deps isn’t mandatory)
fn → performs task
operation
API
src
Takes a glob & represents a file
structure
gulp.src(globs)
globs → file path
API
pipe
for data streaming
(output from prev. process become
input for the next process)
Makes Gulp different compared to
Grunt
.pipe([data_stream])
data_stream → task or file
destination
API
dest
Write files into desired directory
gulp.dest(path)
path → file directory for written
files
API
watch
Watch files and do something
when a file changes
• gulp.watch(glob, fn)
glob → file(s) to watch for changes.
fn → defined function
(added with gulp.task())
gulpfile.js
var [variable_name] = require(‘[plugin_name]');
⋮
gulp.task(‘[task_name]’, function () {
return gulp
.src(‘[file_name]’)
.pipe( [variable_name]() ) ;
⋮
});
gulpfile.js (continued)
gulp.task('watch', function () {
gulp.watch(‘[file_name]', [‘task_name']);
});
package.json
{
"name": “[package_name]",
"dependencies": {
"gulp": "^3.8.5",
"gulp-clean": "^0.3.1",
⋮
}
}
Common
Tasks
• SASS Compile
(gulp-ruby-sass)
• Minify code
.css (gulp-minify-css)
.js & .html (gulp-uglify)
• Watch
(gulp-watch)
vs
GruntGulp
Similarity
• JavaScript-based
task runner
• Running on Node.js
Difference
Build system
workflow
Gulp
Input Read Files
Write Files
Modify Files
Output
Modify Files
Modify Files
Grunt
Input Read Files
Temp folder
Write Files
Read Files
Temp folder
Write Files
Read Files Write Files
Output
Modify Files
Modify Files
Modify Files
Building Responsivity
Uses streams from Node.js,
No any stream use,
some files are stored temporarily
So Gulp builds faster than Grunt!
Configuration & Code
Plugins
Gulp : 432 plugins
Grunt : 2,580 plugins
(as of March 2014)
http://www.oomphinc.com/blog/2014-
03/gulp-vs-grunt-node-js-automation-tools-
showdown/
Example : Compile LESS (Gulp)
Compile LESS (Grunt)
Source
• http://markgoodyear.com/2014/01/getting-started-
with-gulp/
• https://github.com/gulpjs/gulp/blob/master/docs/ge
tting-started.md
• https://www.npmjs.org/
• http://gulpjs.com/
• http://www.oomphinc.com/blog/2014-03/gulp-vs-
grunt-node-js-automation-tools-showdown/
Source
• http://jaysoo.ca/2014/01/27/gruntjs-vs-gulpjs/
• http://blog.ponyfoo.com/2014/07/04/choose-
grunt-gulp-or-npm
• blog.evanyou.me/2013/12/29/gulp-piping/
• http://slides.com/contra/gulp#/

Contenu connexe

Tendances

Quantitative signal detection for the mid sized pharma - webcast
Quantitative signal detection for the mid sized pharma - webcastQuantitative signal detection for the mid sized pharma - webcast
Quantitative signal detection for the mid sized pharma - webcast
pharmasol
 

Tendances (20)

Informedconsent lecture
Informedconsent lectureInformedconsent lecture
Informedconsent lecture
 
Essential documents
Essential documentsEssential documents
Essential documents
 
Cross-Sectional Study.pptx
Cross-Sectional Study.pptxCross-Sectional Study.pptx
Cross-Sectional Study.pptx
 
M.Pharm Project
M.Pharm ProjectM.Pharm Project
M.Pharm Project
 
Devlopment and validation of rp hplc method for simultaneous ex.
Devlopment and validation of rp hplc method for simultaneous ex.Devlopment and validation of rp hplc method for simultaneous ex.
Devlopment and validation of rp hplc method for simultaneous ex.
 
Argus Screen Shots General Tab - Katalyst HLS
Argus Screen Shots General Tab - Katalyst HLSArgus Screen Shots General Tab - Katalyst HLS
Argus Screen Shots General Tab - Katalyst HLS
 
Validation of Analytical and Bioanalytical methods
Validation of Analytical and Bioanalytical methodsValidation of Analytical and Bioanalytical methods
Validation of Analytical and Bioanalytical methods
 
Study Setup_Katalyst HLS
Study Setup_Katalyst HLSStudy Setup_Katalyst HLS
Study Setup_Katalyst HLS
 
Good Laboratory Practices (http://www.ubio.in)
Good Laboratory Practices (http://www.ubio.in)Good Laboratory Practices (http://www.ubio.in)
Good Laboratory Practices (http://www.ubio.in)
 
Pharmacovigilance systems & methodologies across the globe
Pharmacovigilance  systems & methodologies across the globePharmacovigilance  systems & methodologies across the globe
Pharmacovigilance systems & methodologies across the globe
 
Drug safety evaluation in clinical trial
Drug safety evaluation in clinical trialDrug safety evaluation in clinical trial
Drug safety evaluation in clinical trial
 
Quantitative signal detection for the mid sized pharma - webcast
Quantitative signal detection for the mid sized pharma - webcastQuantitative signal detection for the mid sized pharma - webcast
Quantitative signal detection for the mid sized pharma - webcast
 
Blinding in clinical trials
Blinding in clinical trials Blinding in clinical trials
Blinding in clinical trials
 
method validation as per emea.pptx
method validation as per emea.pptxmethod validation as per emea.pptx
method validation as per emea.pptx
 
roles and responsibilities of Investigator[663]
roles and responsibilities of Investigator[663]roles and responsibilities of Investigator[663]
roles and responsibilities of Investigator[663]
 
Investigational product management
Investigational product management Investigational product management
Investigational product management
 
Deconstructing all types of monitoring visits
Deconstructing  all types of monitoring visitsDeconstructing  all types of monitoring visits
Deconstructing all types of monitoring visits
 
JOURNAL CLUB PRESENTATION (20L81S0711-PA)
JOURNAL CLUB PRESENTATION (20L81S0711-PA)JOURNAL CLUB PRESENTATION (20L81S0711-PA)
JOURNAL CLUB PRESENTATION (20L81S0711-PA)
 
System suitability testing
System suitability testingSystem suitability testing
System suitability testing
 
Bioanalytical Method Validation
Bioanalytical Method ValidationBioanalytical Method Validation
Bioanalytical Method Validation
 

En vedette

Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
Docker, Inc.
 

En vedette (13)

Gulp: Task Runner
Gulp: Task RunnerGulp: Task Runner
Gulp: Task Runner
 
Intro to Gulp
Intro to GulpIntro to Gulp
Intro to Gulp
 
Devenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.jsDevenez le plus heureux des Front-end avec Gulp.js
Devenez le plus heureux des Front-end avec Gulp.js
 
JavaScript code academy - introduction
JavaScript code academy - introductionJavaScript code academy - introduction
JavaScript code academy - introduction
 
Vamos automatizar! Conheça o Gulp Js
Vamos automatizar! Conheça o Gulp JsVamos automatizar! Conheça o Gulp Js
Vamos automatizar! Conheça o Gulp Js
 
Grunt and Bower
Grunt and BowerGrunt and Bower
Grunt and Bower
 
gulp-techdencias
gulp-techdenciasgulp-techdencias
gulp-techdencias
 
Bower introduction
Bower introductionBower introduction
Bower introduction
 
Automatización de tareas con Gulp
Automatización de tareas con GulpAutomatización de tareas con Gulp
Automatización de tareas con Gulp
 
Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
Sprite ppt
Sprite pptSprite ppt
Sprite ppt
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 
40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently40+ tips to use Postman more efficiently
40+ tips to use Postman more efficiently
 

Similaire à Introduction to Gulp

Angular workflow with gulp.js
Angular workflow with gulp.jsAngular workflow with gulp.js
Angular workflow with gulp.js
Cihad Horuzoğlu
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
Tino Isnich
 

Similaire à Introduction to Gulp (20)

Gulp - The Streaming Build System
Gulp - The Streaming Build SystemGulp - The Streaming Build System
Gulp - The Streaming Build System
 
Gulp
GulpGulp
Gulp
 
Angular workflow with gulp.js
Angular workflow with gulp.jsAngular workflow with gulp.js
Angular workflow with gulp.js
 
Getting started with gulpjs
Getting started with gulpjsGetting started with gulpjs
Getting started with gulpjs
 
Introduction to GulpJs
Introduction to GulpJsIntroduction to GulpJs
Introduction to GulpJs
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An Introduction
 
Automating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with GulpAutomating Large Applications on Modular and Structured Form with Gulp
Automating Large Applications on Modular and Structured Form with Gulp
 
Automating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with GulpAutomating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with Gulp
 
Plumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshopPlumbin Pipelines - A Gulp.js workshop
Plumbin Pipelines - A Gulp.js workshop
 
JLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App DevelopmentJLPDevs - Optimization Tooling for Modern Web App Development
JLPDevs - Optimization Tooling for Modern Web App Development
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
 
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
From Zero to Hadoop: a tutorial for getting started writing Hadoop jobs on Am...
 
Toolbox of a Ruby Team
Toolbox of a Ruby TeamToolbox of a Ruby Team
Toolbox of a Ruby Team
 
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!TDC2016SP -  Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
TDC2016SP - Esqueça Grunt ou Gulp. Webpack and NPM rule them all!
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Getting Started with Gulp
Getting Started with GulpGetting Started with Gulp
Getting Started with Gulp
 
Gradle Introduction
Gradle IntroductionGradle Introduction
Gradle Introduction
 
Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01Gradleintroduction 111010130329-phpapp01
Gradleintroduction 111010130329-phpapp01
 
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko "Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
"Modern DevOps & Real Life Applications. 3.0.0-devops+20230318", Igor Fesenko
 
Frontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the likeFrontend JS workflow - Gulp 4 and the like
Frontend JS workflow - Gulp 4 and the like
 

Dernier

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Introduction to Gulp

Notes de l'éditeur

  1. Package.json harus ditaruh di dalam direktori yang sama dengan file .js