官术网_书友最值得收藏!

Configuring your environment and tools

One significant aspect to being a productive CoffeeScript developer is having a proper development environment. This environment typically consists of the following:

  • Node.js and the NPM
  • CoffeeScript
  • Code editor
  • Debugger

In this recipe, we will look at installing and configuring the base components and tools necessary to develop CoffeeScript applications.

Getting ready

In this section, we will install the software necessary to develop applications with CoffeeScript.

One of the appealing aspects of developing applications using CoffeeScript is that it is well supported on Mac, Windows, and Linux machines. To get started, you need only a PC and an Internet connection.

How to do it...

CoffeeScript runs on top of Node.js—the event-driven, non-blocking I/O platform built on Chrome's JavaScript runtime. If you do not have Node.js installed, you can download an installation package for your Mac OS X, Linux, and Windows machines from the start page of the Node.js website (http://nodejs.org/).

To begin, install Node.js using an official prebuilt installer; it will also install the NPM.

Next, we will use NPM to install CoffeeScript. Open a terminal or command window and enter the following command:

npm install -g coffee-script

This will install the necessary files needed to work with CoffeeScript, including the coffee command that provides an interactive Read Evaluate Print Loop (REPL)—a command to execute CoffeeScript files and a compiler to generate JavaScript.

It is important to use the -g option when installing CoffeeScript, as this installs the CoffeeScript package as a global NPM module. This will add the necessary commands to our path.

Tip

On some Windows machines, you might need to add the NPM binary directory to your path. You can do this by editing the environment variables and appending ;%APPDATA%\npm to the end of the system's PATH variable.

主站蜘蛛池模板: 怀集县| 五河县| 武宁县| 辛集市| 宕昌县| 焦作市| 阳春市| 永顺县| 定远县| 天津市| 长宁县| 上高县| 辽宁省| 昆山市| 景泰县| 舒城县| 临潭县| 山东| 德安县| 中方县| 苍溪县| 揭西县| 阳曲县| 绥滨县| 文登市| 武威市| 锡林浩特市| 旅游| 溧水县| 石屏县| 湖州市| 临沂市| 珠海市| 理塘县| 万山特区| 长阳| 磐石市| 漳浦县| 平阳县| 鱼台县| 阿坝县|