By Brian P. Hogan

ISBN-10: 1941222110

ISBN-13: 9781941222119

Grunt is all over the place. JavaScript initiatives from jQuery to Twitter Bootstrap use Grunt to transform code, run checks, and convey distributions for creation. it is a construct device within the spirit of Make and Rake, yet written with glossy apps in brain. This booklet will get you in control with Grunt utilizing useful hands-on examples, so that you can wrangle your tasks comfortably. you will methods to create and hold projects and undertaking builds, and automate your workflow with plugins and customized tasks.

JavaScript has moved from being the language you like to hate to the language you should utilize. And as JavaScript purposes get extra complicated, you wish a approach to regulate that complexity. whereas on-line tutorials simply clarify the right way to slap jointly a configuration dossier, this publication is going extra and exhibits you ways to create your individual projects, layout your individual venture templates, mix plugins jointly to convey an internet app to existence, and construct your personal plugins.

You'll begin through studying the fundamentals of activity production, blunders dealing with, and logging as you create an easy configuration that executes simple JavaScript code utilizing Node.js. Then you will leap correct into dossier manipulation as you learn, write, replica, and delete documents. you are going to find out how Grunt's robust multitasks paintings as you construct a job to concatenate documents jointly. as soon as you have a seize on those fundamentals, you are going to construct an easy app with AngularJS and CoffeeScript, utilizing Grunt to do all of the heavy lifting and script processing. eventually, you will create your personal plugin so that you can know the way plugins work.

Each bankruptcy includes hands-on routines and concepts for extra research. even if you rock Ruby or sling C#, Grunt should be an invaluable addition for your toolbox.

What You Need:

This publication covers Grunt 0.4.1 and better, and calls for simple wisdom of JavaScript and command-line instruments on home windows, OS X, or Linux.

Show description

Read Online or Download Automate with Grunt: The Build Tool for JavaScript PDF

Best javascript books

Get Developing Backbone.js Applications PDF

A good way to construct your site’s frontend with the single-page program (SPA) version, this hands-on publication exhibits you ways to get the activity performed with spine. js. You’ll how you can create established JavaScript functions, utilizing Backbone’s personal style of model-view-controller (MVC) structure.

Download e-book for kindle: Create Web Charts with jqPlot by Fabio Nelli

Create internet Charts with jqPlot exhibits easy methods to convert your info into attention-grabbing, leading edge, lively, and hugely interactive browser-based charts. This ebook is acceptable for builders of all adventure degrees and wishes: in the event you love speedy and potent recommendations, you should use the jqPlot library to generate charts with extraordinary results and animations utilizing just a couple of traces of code.

Get Instant Kendo UI Mobile PDF

Sensible recipes to profit the Kendo UI cellular library and its numerous parts for construction cellular functions successfully assessment research whatever new immediately! a quick, quickly, centred advisor offering rapid effects comprehend some of the parts at the Kendo UI cellular software framework discover ways to use a number of the widgets within the Kendo UI cellular library that can assist you construct a cellular program swiftly construct functions that offer local appear and feel with no need to take care of a separate code base intimately The Kendo UI cellular library is a one cease approach to construct cellular functions swiftly.

Extra resources for Automate with Grunt: The Build Tool for JavaScript

Example text

Remove the node_modules folder and then run npm install. You’ll see that npm fetches Grunt again, creating a new node_modules folder. With Grunt installed, we can test things out by running it from the command line: ​ $ ​grunt​ This fires off the grunt-cli library we installed globally, which then uses the grunt library we installed in our project’s node_modules folder. This lets us easily use different versions of Grunt on different projects. But when we look at our output, we see this message: ​ A valid Gruntfile could not be found.

We’ll use simple JavaScript programs to highlight and explore Grunt’s basic features. By the end you’ll be able to create basic tasks and handle errors. Installing Grunt and Configuring a Gruntfile Before we can do anything with Grunt, we have to install the Grunt command-line tool. js, and to install it we use npm, the tool Node uses to download and manage dependencies. Open a new Terminal and type the following command: ​ $ ​npm install -g grunt-cli​ This installs the Grunt command-line utility globally.

Then on line 16, once we’ve parsed the response, we invoke done as a function, which tells Grunt we’re all done. It’s kind of a strange pattern, but it works really well. When we run this task, we get our weather report. 85 degrees ​ ​ Done, without errors. If we added a new target and zip code, we’d get a third response. Multitasks make it very easy to configure a single task to handle multiple outputs. Now let’s look at something a little more practical: file concatenation. Multitasks and Files One of the most common uses for multitasks is in creating distribution packages for JavaScript libraries.

Download PDF sample

Automate with Grunt: The Build Tool for JavaScript by Brian P. Hogan


by Joseph
4.0

Rated 4.59 of 5 – based on 22 votes