<s>
gulp	O
is	O
an	O
open-source	B-Application
JavaScript	B-Language
toolkit	B-Library
created	O
by	O
Eric	O
Schoffstall	O
used	O
as	O
a	O
streaming	O
build	B-Application
system	I-Application
(	O
similar	O
to	O
a	O
more	O
package-focused	O
Make	B-Application
)	O
in	O
front-end	O
web	O
development	O
.	O
</s>
<s>
It	O
is	O
a	O
task	O
runner	O
built	O
on	O
Node.js	B-Language
and	O
npm	B-Language
,	O
used	O
for	O
automation	O
of	O
time-consuming	O
and	O
repetitive	O
tasks	O
involved	O
in	O
web	O
development	O
like	O
minification	B-Language
,	O
concatenation	O
,	O
cache	O
busting	O
,	O
unit	O
testing	O
,	O
linting	B-Device
,	O
optimization	O
,	O
etc	O
.	O
</s>
<s>
gulp	O
is	O
a	O
build	B-Application
tool	I-Application
in	O
JavaScript	B-Language
built	O
on	O
node	B-Application
streams	I-Application
.	O
</s>
<s>
These	O
streams	O
facilitate	O
the	O
connection	O
of	O
file	O
operations	O
through	O
pipelines	B-Operating_System
.	O
</s>
<s>
gulp	O
reads	O
the	O
file	O
system	O
and	O
pipes	B-Operating_System
the	O
data	O
at	O
hand	O
from	O
one	O
single-purposed	O
plugin	O
to	O
another	O
through	O
the	O
.pipe( )	O
operator	O
,	O
doing	O
one	O
task	O
at	O
a	O
time	O
.	O
</s>
<s>
Unlike	O
other	O
task	O
runners	O
that	O
run	O
tasks	O
by	O
configuration	O
,	O
gulp	O
requires	O
knowledge	O
of	O
JavaScript	B-Language
and	O
coding	O
to	O
define	O
its	O
tasks	O
.	O
</s>
<s>
gulp	O
is	O
a	O
build	B-Application
system	I-Application
which	O
means	O
apart	O
from	O
running	O
tasks	O
,	O
it	O
is	O
also	O
capable	O
of	O
copying	O
files	O
from	O
one	O
location	O
to	O
another	O
,	O
compiling	B-Language
,	O
deploying	B-Application
,	O
creating	O
notifications	O
,	O
unit	O
testing	O
,	O
linting	B-Device
,	O
etc	O
.	O
</s>
<s>
Task-runners	O
like	O
gulp	O
and	O
Grunt	B-Language
are	O
built	O
on	O
Node.js	B-Language
rather	O
than	O
npm	B-Language
because	O
the	O
basic	O
npm	B-Language
scripts	O
are	O
inefficient	O
when	O
executing	O
multiple	O
tasks	O
.	O
</s>
<s>
Even	O
though	O
some	O
developers	O
prefer	O
npm	B-Language
scripts	O
because	O
they	O
can	O
be	O
simple	O
and	O
easy	O
to	O
implement	O
,	O
there	O
are	O
numerous	O
ways	O
where	O
gulp	O
and	O
Grunt	B-Language
seem	O
to	O
have	O
an	O
advantage	O
over	O
each	O
other	O
,	O
and	O
the	O
default	O
provided	O
scripts	O
.	O
</s>
<s>
Grunt	B-Language
runs	O
tasks	O
by	O
transforming	O
files	O
and	O
saves	O
them	O
as	O
new	O
ones	O
in	O
temporary	O
folders	O
,	O
and	O
the	O
output	O
of	O
one	O
task	O
is	O
taken	O
as	O
input	O
for	O
another	O
and	O
so	O
on	O
until	O
the	O
output	O
reaches	O
the	O
destination	O
folder	O
.	O
</s>
<s>
This	O
involves	O
a	O
lot	O
of	O
I/O	B-General_Concept
calls	O
and	O
the	O
creation	O
of	O
many	O
temporary	O
files	O
.	O
</s>
<s>
Whereas	O
gulp	O
streams	O
through	O
the	O
file	O
system	O
do	O
not	O
require	O
any	O
of	O
these	O
temporary	O
locations	O
,	O
decreasing	O
the	O
number	O
of	O
I/O	B-General_Concept
calls	O
thus	O
,	O
improving	O
performance	O
.	O
</s>
<s>
Grunt	B-Language
uses	O
configuration	O
files	O
to	O
perform	O
tasks	O
,	O
whereas	O
gulp	O
requires	O
its	O
build	O
file	O
to	O
be	O
coded	O
.	O
</s>
<s>
In	O
Grunt	B-Language
,	O
each	O
plugin	O
needs	O
to	O
be	O
configured	O
to	O
match	O
its	O
input	O
location	O
to	O
the	O
previous	O
plugin	O
's	O
output	O
.	O
</s>
<s>
The	O
gulp	O
tasks	O
are	O
run	O
from	O
a	O
command-line	B-Application
interface	I-Application
(	O
CLI	O
)	O
shell	O
and	O
require	O
two	O
files	O
,	O
package.json	O
,	O
which	O
is	O
used	O
to	O
list	O
the	O
various	O
plugins	O
for	O
gulp	O
,	O
and	O
gulpfile.js	O
(	O
or	O
simply	O
gulpfile	B-Language
)	O
,	O
These	O
,	O
as	O
per	O
build	B-Application
tool	I-Application
convention	O
,	O
are	O
often	O
found	O
in	O
the	O
root	O
directory	O
of	O
the	O
package	O
's	O
source	O
code	O
.	O
</s>
<s>
The	O
gulpfile	B-Language
contains	O
most	O
of	O
the	O
logic	O
that	O
gulp	O
needs	O
to	O
run	O
its	O
build	O
tasks	O
.	O
</s>
<s>
First	O
,	O
all	O
the	O
necessary	O
modules	O
are	O
loaded	O
and	O
then	O
tasks	O
are	O
defined	O
in	O
the	O
gulpfile	B-Language
.	O
</s>
<s>
All	O
the	O
necessary	O
plugins	O
specified	O
in	O
the	O
gulpfile	B-Language
are	O
listed	O
in	O
the	O
devDependencies	O
section	O
of	O
The	O
default	O
task	O
runs	O
by	O
$gulp	O
.	O
</s>
<s>
gulpfile	B-Language
is	O
the	O
place	O
where	O
all	O
the	O
operations	O
are	O
defined	O
in	O
gulp	O
.	O
</s>
<s>
The	O
basic	O
anatomy	O
of	O
the	O
gulpfile	B-Language
consists	O
of	O
required	O
plugins	O
included	O
at	O
the	O
top	O
,	O
definition	O
of	O
the	O
tasks	O
and	O
a	O
default	O
task	O
at	O
the	O
end	O
.	O
</s>
<s>
Any	O
installed	O
plugin	O
that	O
is	O
required	O
to	O
perform	O
a	O
task	O
is	O
to	O
be	O
added	O
at	O
the	O
top	O
of	O
the	O
gulpfile	B-Language
as	O
a	O
dependency	O
in	O
the	O
following	O
format	O
.	O
</s>
<s>
The	O
default	O
task	O
is	O
to	O
be	O
defined	O
at	O
the	O
end	O
of	O
the	O
gulpfile	B-Language
.	O
</s>
<s>
The	O
module	O
definition	O
can	O
be	O
at	O
the	O
beginning	O
of	O
Gulpfile.js	O
like	O
so	O
:	O
</s>
<s>
In	O
the	O
following	O
example	O
,	O
all	O
JavaScript	B-Language
files	O
from	O
the	O
directory	O
scripts/	O
'	O
are	O
optimized	O
with	O
.pipe(uglify( )	O
)	O
and	O
gulp.dest	O
( 'scripts/'	O
)	O
overwrites	O
the	O
original	O
files	O
with	O
the	O
output	O
.	O
</s>
<s>
For	O
this	O
,	O
one	O
must	O
first	O
return	O
to	O
the	O
required	O
gulp-uglify	O
plugin	O
on	O
npm	B-Language
package	O
installer	O
and	O
at	O
the	O
beginning	O
of	O
gulpfile	B-Language
,	O
the	O
module	O
should	O
be	O
defined	O
.	O
</s>
<s>
In	O
the	O
following	O
example	O
,	O
the	O
tasks	O
with	O
the	O
names	O
scripts	O
and	O
images''	O
are	O
called	O
when	O
any	O
of	O
JavaScript	B-Language
files	O
or	O
images	O
change	O
in	O
the	O
specified	O
directories	O
.	O
</s>
