I get busy learning some other things and Node.js gets all easy! I’m impressed. ๐
1. Navigate to the main node.js site, there’s a big “Download” button that you can’t miss.

2. Click that download buttonย and you’ll be presented with this crazy easy screen to pick your download.

3. Once you get that installed, get nodeunit. You are writing unit tests against your node code right? ๐
[sourcecode language=”javascript”]
npm install nodeunit
[/sourcecode]

For more on how to use npm, which stands for Node Package Manager, give a RTFM. ๐ ย It’s kind of like Nuget for .NETters and Gems for Rubyists. ย ๐ …and trust me, I’ll be putting this to use in future blog entries and it’s a big help to have handy.
4. Create a file to code some javascript in. Per the simple example given on the main node site…
[sourcecode language=”language"javascript"”]
var http = require(‘http’);
http.createServer(function (req, res) {ย ย res.writeHead(200, {‘Content-Type’: ‘text/plain’});
res.end(‘Hello World\n’);}).listen(1337, "127.0.0.1");
console.log(‘Server running at http://127.0.0.1:1337/’);
[/sourcecode]
Now run this. If you have the Webstorm IDE from Jetbrains you can just right click on the js file and select run. It automatically will use Node.js to execute your JavaScript. You can also execute node.js by opening up a shell/terminal and executing this.
[sourcecode langugae=”bash”]
node whereverYourPathIsTheFileIsLocated/example.js
[/sourcecode]
Navigate to 127.0.0.1:1337 and you’ll get the classic “Hello World” message.

…and all of a sudden you’re using node.js to hack some javascript! Seriously, there aren’t many usable languages out there that are as code ready as javascript with node. Very cool, very very cool.
Happy coding!