NodeJS Get started in Mac OS X

Install

Fortunately, nodejs installer was prepared.
Please access node.js and download .pkg.
You can install with only double click pkg.

Path?

After install you can check

which node   # /usr/local/bin/node

First Sample

Sample

Create javascript file ex sample.js

var http = require('http');
var server = http.createServer(); server.on('request', doRequest); server.listen(1234);
function doRequest(req, res) {
   res.writeHead(200, {'Content-Type': 'text/plain'}); res.write('Hello!');
   res.end();
}

Run

Use node command

node sample.js

Node runs, and the target is sample.js

Check

You access http://localhost:1234, you can see Hello!

Eclipse

Plugin

Add Nodeclipse plugin. You need to add http://dl.bintray.com/nodeclipse/nodeclipse/
to install web URL.
nodeeclipse
Select all Node package module bundle, Nodeclipse, Tools

Node Project

After install, you can use Node Project from eclipse.
File -> New -> Project -> Node -> Node Project
nodeproject
Project components are following

Project
| - hello-world-server.js  : Server side main codes
| - JavaScript Reosouece   : Eclipse setting
| - package.json           : Package
| - README.md              : Readme like github

Debug, Run

File Select -> Run -> Debug -> Node Application
Runnodeproejct
Server running at http://127.0.0.1:1337/ This info is under your eclipse console.