SlideShare a Scribd company logo
1 of 19
Download to read offline
Gulp- The Streaming Build System
Sunniya Maini
Gulp- The Streaming Build System
Sunniya Maini
www.tothenew.com
Build System
Input Executive Task Output
• Reforming and optimising the assets of a website is not a part of any design
process.
• This consists of repetitive tasks that can be automated with a build tool to
improve web efficiency. This whole process makes a build system.
Example of build tools: Gulp, Grunt, Broccoli and Brunch etc.
www.tothenew.com
Explore Gulp
What is Gulp?
• A front-end development tool
• A streaming build system, basically, it's a way of doing automatically the tasks that you would have
to do yourself again and again.
• Or It’s streaming nature is what allows it to pipe and pass around the data being manipulated or
used by it’s plugins. The plugins are intended to only do one job each, so it’s not uncommon to pass
a singular file through multiple plugins.
• A JavaScript task runner, designed to automate (run) common tasks
www.tothenew.com
What Gulp Does?
When it comes to web development, it perform several tasks:
• Unit testing
• JS Linting
• Concatenating/minifying
• Image optimization
• Replace scripts in HTML files
• SASS/LESS
• And more..
www.tothenew.com
Build System for GULP
Input Read Files Modify Files
Modify Files
Modify FilesWrite FilesOutput
www.tothenew.com
Why Gulp ?
Easy to use:
Gulp keeps things simple and helps easy management of complex tasks by preferring code
over configuration.
Efficient:
Gulp uses the power of Node streams to give fast builds that don't write intermediary files to
disk.
High Quality:
With strict guidelines enforced, it is ensured that plugins work simple as expected.
Easy to Learn:
Your build works exactly as you expect, as a minimal API surface is maintained and the best
practices of Node are followed.
www.tothenew.com
Getting Started
www.tothenew.com
Install Gulp on your workstation and learn CLI
Install node.js
https://nodejs.org/
Install Gulp
$ npm install gulp –g
Where,
• $ represent command prompt, not a part of code.
• npm install, command that uses node package manager to install Gulp in your machine.
• -g, intstruct npm to install Gulp globally, so that you can access Gulp from anywhere on your machine.
www.tothenew.com
Create a Gulp project
Run npm init: Creates a package.json file in project which stores information about the project, like
the dependencies used in the project
This command prompts like:
www.tothenew.com
Dev dependencies
Once package.json is created, we can install Gulp for project only.
$ npm install gulp --save-dev
“--save-dev” tells machine to add Gulp as a dev dependency in package.json
Gulp environment is setup.
www.tothenew.com
API: 4 level of functioning
Gulp is a streaming build system. It’s streaming nature is what allows it to pipe and pass around the
data being manipulated or used by it’s plugins. The plugins are intended to only do one job each, so
it’s not uncommon to pass a singular file through multiple plugins.
• task
• src
• pipe
• dest
• watch
www.tothenew.com
General directory structure for gulp project
www.tothenew.com
Install Plugins
 Go to cmd:
npm install <plugin-name> --save-dev
 Go to gulpfile.js:
require/add plugin in this file
 Again in gulpfile.js:
add task
 Go to cmd:
run task: $ gulp task-name
www.tothenew.com
Task: defining a task
In a gulp task, it read some files using gulp.src,
pass them through various transformations using the pipe function,
and finally write them back to disk by piping to gulp.dest
gulp.task('task-name', function() {
// Stuff here
});
task-name refers to name of task
Example:
gulp.task('hello', function() {
console.log('Hello World');
});
Run: $ gulp hello
www.tothenew.com
gulp-uglify: minify files
Install:
$ npm install gulp-uglify --save-dev
Usage:
Gulpfile.js:
var uglify = require(‘gulp-uglify’);
Task:
gulp.task(‘default’, function() {
gulp.src(‘src/js/*.js’)
.pipe(uglify())
.pipe(gulp.dest(‘dist’));
});
Run on command prompt:
$ gulp
If you want to specify a name to a task write:
www.tothenew.com
Continued
If you want to specify a name to a task write:
Task:
gulp.task(‘scripts’, function() {
gulp.src(‘src/js/*.js’)
.pipe(uglify())
.pipe(gulp.dest(‘dist’));
});
Run on command prompt:
$ gulp scripts
Concept of streams based on above example:
As we know, streams enable you to pass some data through a number of usually small functions, which will modify
the data and then pass the modified data to the next function.
In the example above, the gulp.src() function takes a string, which matches a file or number of files (known as a
“glob”), and creates a stream of objects representing those files. They are then passed (or piped) to
the uglify()function, which takes the file objects and returns new file objects along with a minified source. The
output is then piped to the gulp.dest() function, which saves the changed files.
www.tothenew.com
Resources
https://www.npmjs.com/package/gulp-uglify
https://www.youtube.com/watch?v=dwSLFai8ovQ
http://gulpjs.com/
http://www.slideshare.net/christopherabautista/taking-gulp/13
Client Location
Our Office
Contact us
We are keen to know
about your idea
info@tothenew.com
Email us at
Let’s stay connected

More Related Content

What's hot

Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.jsBo-Yi Wu
 
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 likeDamien Seguin
 
GulpJs - An Introduction
GulpJs - An IntroductionGulpJs - An Introduction
GulpJs - An IntroductionKnoldus Inc.
 
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 GulpAnderson Aguiar
 
JavaScript code academy - introduction
JavaScript code academy - introductionJavaScript code academy - introduction
JavaScript code academy - introductionJaroslav Kubíček
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation Prashant Shrestha
 
Grunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerGrunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerMohammed Arif
 
Getting started with gulpjs
Getting started with gulpjsGetting started with gulpjs
Getting started with gulpjsunmesh dusane
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Gruntbenko
 
Automating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with GulpAutomating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with GulpMike Hale
 
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!tdc-globalcode
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開KAI CHU CHUNG
 
Modernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerModernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerAlan Crissey
 
Grunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntGrunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntDouglas Reynolds
 
Develop - Project Scaffolding
Develop - Project ScaffoldingDevelop - Project Scaffolding
Develop - Project ScaffoldingKevin Cao
 
Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Joe Ferguson
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flowWes Eklund
 

What's hot (20)

Automating your workflow with Gulp.js
Automating your workflow with Gulp.jsAutomating your workflow with Gulp.js
Automating your workflow with Gulp.js
 
JavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & GruntJavaScript Task Runners - Gulp & Grunt
JavaScript Task Runners - Gulp & Grunt
 
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
 
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
 
JavaScript code academy - introduction
JavaScript code academy - introductionJavaScript code academy - introduction
JavaScript code academy - introduction
 
Gulp and bower Implementation
Gulp and bower Implementation Gulp and bower Implementation
Gulp and bower Implementation
 
Grunt - The JavaScript Task Runner
Grunt - The JavaScript Task RunnerGrunt - The JavaScript Task Runner
Grunt - The JavaScript Task Runner
 
Getting started with gulpjs
Getting started with gulpjsGetting started with gulpjs
Getting started with gulpjs
 
gulp
gulpgulp
gulp
 
Front-end development automation with Grunt
Front-end development automation with GruntFront-end development automation with Grunt
Front-end development automation with Grunt
 
What grunt?
What grunt?What grunt?
What grunt?
 
Automating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with GulpAutomating WordPress Plugin Development with Gulp
Automating WordPress Plugin Development with Gulp
 
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!
 
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
60分鐘完送百萬edm,背後雲端ci/cd實戰大公開
 
Modernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & BowerModernizing Your WordPress Workflow with Grunt & Bower
Modernizing Your WordPress Workflow with Grunt & Bower
 
Grunt JS - Getting Started With Grunt
Grunt JS - Getting Started With GruntGrunt JS - Getting Started With Grunt
Grunt JS - Getting Started With Grunt
 
Develop - Project Scaffolding
Develop - Project ScaffoldingDevelop - Project Scaffolding
Develop - Project Scaffolding
 
Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021Modern infrastructure as code with ansible cake fest 2021
Modern infrastructure as code with ansible cake fest 2021
 
Dial up your flow
Dial up your flowDial up your flow
Dial up your flow
 

Viewers also liked

gasdj456djkdi3353452
gasdj456djkdi3353452gasdj456djkdi3353452
gasdj456djkdi3353452cephas3
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlTO THE NEW | Technology
 
Production schedule 2011
Production schedule 2011Production schedule 2011
Production schedule 2011sathma
 
FUKUYAMA BASE WORKSHOP Vol11 Theme
FUKUYAMA BASE WORKSHOP Vol11 ThemeFUKUYAMA BASE WORKSHOP Vol11 Theme
FUKUYAMA BASE WORKSHOP Vol11 Themenoteproject
 
Inquiry 2010 term two
Inquiry 2010 term twoInquiry 2010 term two
Inquiry 2010 term twoemily
 
2010 SMX Advanced - Advanced CRO Beyond the Landing Page
2010 SMX Advanced - Advanced CRO Beyond the Landing Page2010 SMX Advanced - Advanced CRO Beyond the Landing Page
2010 SMX Advanced - Advanced CRO Beyond the Landing PageVertster.com
 
Sanat
SanatSanat
Sanatmerve
 
1000 TETTI FOTOVOLTAICI BANDO
1000 TETTI FOTOVOLTAICI BANDO 1000 TETTI FOTOVOLTAICI BANDO
1000 TETTI FOTOVOLTAICI BANDO Il Lavoro Solidale
 
La Vall De Segó Cantera Ave 100616
La Vall De Segó Cantera Ave 100616La Vall De Segó Cantera Ave 100616
La Vall De Segó Cantera Ave 100616qvalls
 
FUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 ThemeFUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 Themenoteproject
 
Stop Sending Email! Start Sending Multi-channel messages that matter
Stop Sending Email! Start Sending Multi-channel messages that matterStop Sending Email! Start Sending Multi-channel messages that matter
Stop Sending Email! Start Sending Multi-channel messages that matterJohn Watton
 
Scambio sul posto dell\'energia
Scambio sul posto dell\'energiaScambio sul posto dell\'energia
Scambio sul posto dell\'energiaIl Lavoro Solidale
 
The body
The bodyThe body
The bodyLauren
 
10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:TO THE NEW | Technology
 
Office 365 voor het onderwijs
Office 365 voor het onderwijsOffice 365 voor het onderwijs
Office 365 voor het onderwijsIT-Workz
 
Traditional mural vs non traditional mural
Traditional mural vs non traditional muralTraditional mural vs non traditional mural
Traditional mural vs non traditional muralsathma
 

Viewers also liked (20)

gasdj456djkdi3353452
gasdj456djkdi3353452gasdj456djkdi3353452
gasdj456djkdi3353452
 
Edisi78
Edisi78Edisi78
Edisi78
 
MongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behlMongoDB using Grails plugin by puneet behl
MongoDB using Grails plugin by puneet behl
 
Production schedule 2011
Production schedule 2011Production schedule 2011
Production schedule 2011
 
FUKUYAMA BASE WORKSHOP Vol11 Theme
FUKUYAMA BASE WORKSHOP Vol11 ThemeFUKUYAMA BASE WORKSHOP Vol11 Theme
FUKUYAMA BASE WORKSHOP Vol11 Theme
 
Portfolio
PortfolioPortfolio
Portfolio
 
Inquiry 2010 term two
Inquiry 2010 term twoInquiry 2010 term two
Inquiry 2010 term two
 
2010 SMX Advanced - Advanced CRO Beyond the Landing Page
2010 SMX Advanced - Advanced CRO Beyond the Landing Page2010 SMX Advanced - Advanced CRO Beyond the Landing Page
2010 SMX Advanced - Advanced CRO Beyond the Landing Page
 
Sanat
SanatSanat
Sanat
 
1000 TETTI FOTOVOLTAICI BANDO
1000 TETTI FOTOVOLTAICI BANDO 1000 TETTI FOTOVOLTAICI BANDO
1000 TETTI FOTOVOLTAICI BANDO
 
Presentacin1
Presentacin1Presentacin1
Presentacin1
 
La Vall De Segó Cantera Ave 100616
La Vall De Segó Cantera Ave 100616La Vall De Segó Cantera Ave 100616
La Vall De Segó Cantera Ave 100616
 
FUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 ThemeFUKUYAMA BASE WORKSHOP Vol13 Theme
FUKUYAMA BASE WORKSHOP Vol13 Theme
 
Stop Sending Email! Start Sending Multi-channel messages that matter
Stop Sending Email! Start Sending Multi-channel messages that matterStop Sending Email! Start Sending Multi-channel messages that matter
Stop Sending Email! Start Sending Multi-channel messages that matter
 
Scambio sul posto dell\'energia
Scambio sul posto dell\'energiaScambio sul posto dell\'energia
Scambio sul posto dell\'energia
 
Unit v
Unit vUnit v
Unit v
 
The body
The bodyThe body
The body
 
10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:10 Pragmatic UX techniques for building smarter products:
10 Pragmatic UX techniques for building smarter products:
 
Office 365 voor het onderwijs
Office 365 voor het onderwijsOffice 365 voor het onderwijs
Office 365 voor het onderwijs
 
Traditional mural vs non traditional mural
Traditional mural vs non traditional muralTraditional mural vs non traditional mural
Traditional mural vs non traditional mural
 

Similar to Gulp - The Streaming Build System

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 DevelopmentJLP Community
 
Time's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save YoursTime's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save YoursJames Bundey
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development ToolsYe Maw
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDAndi Smith
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient waySylvain Rayé
 
Introduction to GulpJs
Introduction to GulpJsIntroduction to GulpJs
Introduction to GulpJsHarish Gadiya
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopleffen
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpackNodeXperts
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCPDana Hoffman
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IOded Sagir
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingStanislav Osipov
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end WorkflowPagepro
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to AnsibleCédric Delgehier
 
Grunt js and WordPress
Grunt js and WordPressGrunt js and WordPress
Grunt js and WordPressWP Australia
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeomanhassan hafez
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsDominik Prokop
 

Similar to Gulp - The Streaming Build System (20)

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
 
Time's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save YoursTime's Important - Let Task Management Save Yours
Time's Important - Let Task Management Save Yours
 
Modern Development Tools
Modern Development ToolsModern Development Tools
Modern Development Tools
 
Gulp js
Gulp jsGulp js
Gulp js
 
Front end development gurant
Front end development gurantFront end development gurant
Front end development gurant
 
Quest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFREDQuest for the Perfect Workflow for McrFRED
Quest for the Perfect Workflow for McrFRED
 
Capistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient wayCapistrano deploy Magento project in an efficient way
Capistrano deploy Magento project in an efficient way
 
Introduction to GulpJs
Introduction to GulpJsIntroduction to GulpJs
Introduction to GulpJs
 
Modern web technologies
Modern web technologiesModern web technologies
Modern web technologies
 
OSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshopOSDC.no 2015 introduction to node.js workshop
OSDC.no 2015 introduction to node.js workshop
 
Improving build solutions dependency management with webpack
Improving build solutions  dependency management with webpackImproving build solutions  dependency management with webpack
Improving build solutions dependency management with webpack
 
Infrastructure Management in GCP
Infrastructure Management in GCPInfrastructure Management in GCP
Infrastructure Management in GCP
 
The Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session IThe Secrets of The FullStack Ninja - Part A - Session I
The Secrets of The FullStack Ninja - Part A - Session I
 
SCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scalingSCM Puppet: from an intro to the scaling
SCM Puppet: from an intro to the scaling
 
Grunt & Front-end Workflow
Grunt & Front-end WorkflowGrunt & Front-end Workflow
Grunt & Front-end Workflow
 
#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible#OktoCampus - Workshop : An introduction to Ansible
#OktoCampus - Workshop : An introduction to Ansible
 
Grunt js and WordPress
Grunt js and WordPressGrunt js and WordPress
Grunt js and WordPress
 
Gulp overview
Gulp overviewGulp overview
Gulp overview
 
Front end workflow with yeoman
Front end workflow with yeomanFront end workflow with yeoman
Front end workflow with yeoman
 
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.jsGDG Kraków - Intro to front-end automation using bower.js & grunt.js
GDG Kraków - Intro to front-end automation using bower.js & grunt.js
 

More from TO THE NEW | Technology

10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!TO THE NEW | Technology
 
12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective CTO THE NEW | Technology
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptTO THE NEW | Technology
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape SoftwareTO THE NEW | Technology
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchTO THE NEW | Technology
 

More from TO THE NEW | Technology (20)

10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!10 Best Node.js Practices you Need to Know!
10 Best Node.js Practices you Need to Know!
 
12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C12 Key points which make Swift more effective than Objective C
12 Key points which make Swift more effective than Objective C
 
Grails Spring Boot
Grails Spring BootGrails Spring Boot
Grails Spring Boot
 
AWS Elastic Beanstalk
AWS Elastic BeanstalkAWS Elastic Beanstalk
AWS Elastic Beanstalk
 
Content migration to AEM
Content migration to AEMContent migration to AEM
Content migration to AEM
 
AWS CodeDeploy
AWS CodeDeployAWS CodeDeploy
AWS CodeDeploy
 
Big Data Expertise
Big Data ExpertiseBig Data Expertise
Big Data Expertise
 
An introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScriptAn introduction to Object Oriented JavaScript
An introduction to Object Oriented JavaScript
 
Object Oriented JavaScript - II
Object Oriented JavaScript - IIObject Oriented JavaScript - II
Object Oriented JavaScript - II
 
MongoDb and NoSQL
MongoDb and NoSQLMongoDb and NoSQL
MongoDb and NoSQL
 
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
(AWS) Auto Scaling : Evening Session by Amazon and IntelliGrape Software
 
Cloud Formation
Cloud FormationCloud Formation
Cloud Formation
 
BigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearchBigData Search Simplified with ElasticSearch
BigData Search Simplified with ElasticSearch
 
JULY IN GRAILS
JULY IN GRAILSJULY IN GRAILS
JULY IN GRAILS
 
Grails Spock Testing
Grails Spock TestingGrails Spock Testing
Grails Spock Testing
 
Getting groovier-with-vertx
Getting groovier-with-vertxGetting groovier-with-vertx
Getting groovier-with-vertx
 
Introduction to Kanban
Introduction to KanbanIntroduction to Kanban
Introduction to Kanban
 
Introduction to Heroku
Introduction to HerokuIntroduction to Heroku
Introduction to Heroku
 
Node JS
Node JSNode JS
Node JS
 
MongoDB (Advanced)
MongoDB (Advanced)MongoDB (Advanced)
MongoDB (Advanced)
 

Recently uploaded

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetEnjoy Anytime
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 

Recently uploaded (20)

Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your BudgetHyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
Hyderabad Call Girls Khairatabad ✨ 7001305949 ✨ Cheap Price Your Budget
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 

Gulp - The Streaming Build System

  • 1. Gulp- The Streaming Build System Sunniya Maini
  • 2. Gulp- The Streaming Build System Sunniya Maini
  • 3. www.tothenew.com Build System Input Executive Task Output • Reforming and optimising the assets of a website is not a part of any design process. • This consists of repetitive tasks that can be automated with a build tool to improve web efficiency. This whole process makes a build system. Example of build tools: Gulp, Grunt, Broccoli and Brunch etc.
  • 4. www.tothenew.com Explore Gulp What is Gulp? • A front-end development tool • A streaming build system, basically, it's a way of doing automatically the tasks that you would have to do yourself again and again. • Or It’s streaming nature is what allows it to pipe and pass around the data being manipulated or used by it’s plugins. The plugins are intended to only do one job each, so it’s not uncommon to pass a singular file through multiple plugins. • A JavaScript task runner, designed to automate (run) common tasks
  • 5. www.tothenew.com What Gulp Does? When it comes to web development, it perform several tasks: • Unit testing • JS Linting • Concatenating/minifying • Image optimization • Replace scripts in HTML files • SASS/LESS • And more..
  • 6. www.tothenew.com Build System for GULP Input Read Files Modify Files Modify Files Modify FilesWrite FilesOutput
  • 7. www.tothenew.com Why Gulp ? Easy to use: Gulp keeps things simple and helps easy management of complex tasks by preferring code over configuration. Efficient: Gulp uses the power of Node streams to give fast builds that don't write intermediary files to disk. High Quality: With strict guidelines enforced, it is ensured that plugins work simple as expected. Easy to Learn: Your build works exactly as you expect, as a minimal API surface is maintained and the best practices of Node are followed.
  • 9. www.tothenew.com Install Gulp on your workstation and learn CLI Install node.js https://nodejs.org/ Install Gulp $ npm install gulp –g Where, • $ represent command prompt, not a part of code. • npm install, command that uses node package manager to install Gulp in your machine. • -g, intstruct npm to install Gulp globally, so that you can access Gulp from anywhere on your machine.
  • 10. www.tothenew.com Create a Gulp project Run npm init: Creates a package.json file in project which stores information about the project, like the dependencies used in the project This command prompts like:
  • 11. www.tothenew.com Dev dependencies Once package.json is created, we can install Gulp for project only. $ npm install gulp --save-dev “--save-dev” tells machine to add Gulp as a dev dependency in package.json Gulp environment is setup.
  • 12. www.tothenew.com API: 4 level of functioning Gulp is a streaming build system. It’s streaming nature is what allows it to pipe and pass around the data being manipulated or used by it’s plugins. The plugins are intended to only do one job each, so it’s not uncommon to pass a singular file through multiple plugins. • task • src • pipe • dest • watch
  • 14. www.tothenew.com Install Plugins  Go to cmd: npm install <plugin-name> --save-dev  Go to gulpfile.js: require/add plugin in this file  Again in gulpfile.js: add task  Go to cmd: run task: $ gulp task-name
  • 15. www.tothenew.com Task: defining a task In a gulp task, it read some files using gulp.src, pass them through various transformations using the pipe function, and finally write them back to disk by piping to gulp.dest gulp.task('task-name', function() { // Stuff here }); task-name refers to name of task Example: gulp.task('hello', function() { console.log('Hello World'); }); Run: $ gulp hello
  • 16. www.tothenew.com gulp-uglify: minify files Install: $ npm install gulp-uglify --save-dev Usage: Gulpfile.js: var uglify = require(‘gulp-uglify’); Task: gulp.task(‘default’, function() { gulp.src(‘src/js/*.js’) .pipe(uglify()) .pipe(gulp.dest(‘dist’)); }); Run on command prompt: $ gulp If you want to specify a name to a task write:
  • 17. www.tothenew.com Continued If you want to specify a name to a task write: Task: gulp.task(‘scripts’, function() { gulp.src(‘src/js/*.js’) .pipe(uglify()) .pipe(gulp.dest(‘dist’)); }); Run on command prompt: $ gulp scripts Concept of streams based on above example: As we know, streams enable you to pass some data through a number of usually small functions, which will modify the data and then pass the modified data to the next function. In the example above, the gulp.src() function takes a string, which matches a file or number of files (known as a “glob”), and creates a stream of objects representing those files. They are then passed (or piped) to the uglify()function, which takes the file objects and returns new file objects along with a minified source. The output is then piped to the gulp.dest() function, which saves the changed files.
  • 19. Client Location Our Office Contact us We are keen to know about your idea info@tothenew.com Email us at Let’s stay connected