Gulp.js: Difference between revisions

Content deleted Content added
Stiruma (talk | contribs)
citations added
Line 18:
gulp<ref>{{Cite web|url=https://github.com/gulpjs/gulp/blob/master/docs/FAQ.md|title=gulpjs/gulp|website=GitHub|access-date=2016-09-22}}</ref> is a build tool in JavaScript built on [[Node stream|node streams]]. These streams facilitate the connection of file operations through [[Pipeline (software)|pipelines]]<ref>{{url|https://github.com/substack/stream-handbook}}</ref>. gulp reads the file system and pipes the data at hand from its one single-purposed plugin to other through the <code>.pipe()</code> operator, doing one task at a time. The original files are not affected until all the plugins are processed. It can be configured either to modify the original files or to create new ones. This grants the ability to perform complex tasks through linking its numerous plugins. The users can also write their own plugins to define their own tasks<ref>{{Cite web|url=https://github.com/gulpjs/gulp/blob/master/docs/writing-a-plugin/README.md|title=gulpjs/gulp|website=GitHub|access-date=2016-09-22}}</ref>. Unlike other task runners that run tasks by configuration, gulp requires knowledge of JavaScript and coding to define its tasks. gulp is a build system which means apart from running tasks, it is also capable of copying files from one ___location to another, [[compiling]], [[Software deployment|deploying]], creating notifications, unit testing, linting etc<ref name=":0" />.
 
== WhyWhat gulpis overthe Gruntneed for a Task Runner? ==
The main reason why task-runners like gulp and grunt are built on node is because, the basic npm scripts are not efficient when it comes to executing multiple tasks.
BothEven Gruntthough a few developers prefer npm scripts to be simple and gulpeasy to implement, there are tasknumerous runnersways inwhere JavaScriptgulp builtand ongrunt seem to have an advantage over each other and the default provided nodescripts. Grunt runs tasks by transforming files and saves as new ones in temporary folders. Theand the output of one task is taken as input for another and so on until the output reaches the destination folder. This involves a lot of [[I/O]] calls and creation of many temporary files. Whereas gulp streams through the file system and does not require any of these temporary locations decreasing the number of I/O calls thus, improving performance. Grunt uses configuration files to perform tasks whereas gulp requires its build file to be coded. In grunt, each plugin needs to be configured to match its input ___location to the previous plugin’s output. In gulp, the plugins are automatically pipe-lined.
 
== Installation ==