Be not afraid. Gulp.
Things that work for you are neat. Things that do that for you while you work on other more important things (like making software) are even better.
If you’re using Sass, then you’re familiar with this concept with
sass --watch
Where you can merrily code away while your CSS compiles every time you save your latest masterpiece.
If a sass watch (which I oftentimes refer to as a “sasquatch”) doesn’t phase you, then you’ll love Gulp, a node based task runner. Its easy to get started with and easily customizable with recipes galore, and quite a bit of readable documentation. Basically, if you can think it, you can Gulp it.
I recently tried out my first gulp project on a static node-express server, and fell in computer love. I wrote up a couple of tasks in just a couple of minutes to compile my CSS, crunch down my JavaScript and even one to tell me where I could have written my code better automatically! And all of this happened every time I saved my work! Pretty neat!
There’s a lot of really great primers out there on how to get started with Gulp, such as this one, this one and from the site itself , so I’ll save you the how to’s on that. Instead, I’ll give you my observations post first gulpfile.
First, with great (automating) power comes great (debugging) responsibility. For example, as I was going about my business linting, concatenating and minifying my javascript on this project on the fly, every time I saved my javascript file, Gulp just dumped another version of the same function into my neatly minified file because I didn’t include anything to overwrite the existing file. So I quickly learned that proper project planning is essential when using Gulp, as well as knowing what your tool does. (I later went back and reconfigured my gulpfile and index page references to reflect a development state as well as a production state.)
Secondly, it helps to know what all of your modules are really doing before you start mimicking someone’s pre-existing code. Originally, I tried Mark Goodyear’s tutorial (which I thought was great for understanding what I might be able to do) but had more bells and whistles than I had wanted on my first run. So rather than just copying and pasting his completed code snippet, I went through and carefully dissected what each module I was using was doing- or could be doing. By doing this, I was forced to think of how I wanted my gulp file to help me, and how to creatively do that.
Lastly, I examined how other people used Gulp in their projects. I thoroughly enjoyed meandering through recipes and blog posts, which encouraged me to think outside of the first tutorial box. I watched vlogs of people live coding through projects, explaining line by line what they were doing and thinking. It opened up the infinite realm of what my Gulp possibilities were.
Overall, getting started with Gulp is really easy for the JavaScript beginner and lets you get to the more important things- such as making great software. Be not afraid of your task runner. Take a big Gulp.














