JavaScript is the lingua franca of the web. We use it for web pages, obviously. But we also use it when creating cross-platform mobile apps with Cordova (AKA PhoneGap). We occasionally use Node.js for serving HTTP – usually for WebSockets. The JavaScript development landscape has grown a lot recently, including a lot of tooling written in JavaScript.
We install the V8 JavaScript interpreter, Node.js, and npm (the node package manager) with a single Homebrew command:
brew install node
We install packages via npm.
First, we'll install Express, for cases where we want to build a web server with a little more than the basics that Node.js gives us. We'll install CoffeeScript, our preferred JavaScript "dialect", and LESS, the JavaScript preferred "dialect" for CSS. We'll also install Jade, which is basically the JavaScript version of HAML.
npm install -g express npm install -g coffee-script npm install -g less npm install -g jade
We'll install several tools to assist in building JavaScript apps. These include Grunt, Yeoman, Lineman, and the Cordova CLI.
npm install -g grunt npm install -g yo npm install -g generator-cordova npm install -g generator-webapp npm install -g lineman npm install -g cordova