Testing our Node installation

Let's make sure your Node installation is working properly. Check the version number with node -v. We will be shown a version number, as follows:

node -v
v0.8.15

Now let's open up the Node console. This is an interactive tool that lets you run JavaScript right from your command line! It can be very helpful if you want to try out small ideas in code and receive immediate feedback. We'll see later that CoffeeScript provides an equivalent console.

Run this:

node

You will be presented with a prompt. Try entering some JavaScript code, and hit Enter to execute.

> "Hello, world!"
'Hello, world!'
> var x = 3 + 7
undefined
> x / 2
5

Tip

Downloading the example code

You can download the example code files for all Packt books you ...

Get CoffeeScript Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.