Node by example: 1. Introduction & Installation
Published on March 25, 2010
0 Comments
i. Introduction
node-by-example is a collection of short code samples, that showcase some of the available features using Node.JS
The code samples are based on the Node.JS documentation, its unit test code, code posted online and made up by myself.
You can download the code here: http://github.com/Hendrik/node-by-example
I assume you are familiar with JavaScript and already know what Node.JS is, so that I will skip the introduction of Node.JS itself and jump right into the first code sample.
For more details about Node.JS itself please see the official website ( http://nodejs.org/ ) and Ryan Dahl's JSConf 2009 presentation about Node.JS ( http://blip.tv/file/2899135 )
1. Installation
The following is a list of the required apps & modules needed to run all of the provided code samples.
You only need node.js to get started, the rest is required for the later parts.
Apps:
- node.js: http://nodejs.org/
- MySQL: http://mysql.com/
- DBSlayer: http://code.nytimes.com/projects/dbslayer
node.js Modules:
- node-geoip: http://github.com/strange/node-geoip
- node.ws.js: http://github.com/ncr/node.ws.js
- node-ws-client.js: http://code.google.com/p/revhttp/source/browse/trunk/nodejs/node-ws-client.js
- node.dbslayer.js: http://github.com/shoeman22/node.dbslayer.js
Other:
- Browser with WebSocket support, e.g.: Google Chrome: http://www.google.com/chrome/
- Google maps api key
Node.JS installation:
You can download the latest release here: http://nodejs.org/#download
Node eventually wants to support all POSIX operating systems (including Windows with MinGW) but at the moment it is only being tested on Linux, Macintosh, and FreeBSD. The build system requires Python 2.4 or better. V8, on which Node is built, supports only IA-32 and ARM processors. V8 is included in the Node distribution. To use TLS, GnuTLS and libgpg-error are required. There are no other dependencies. [1]
After you have downloaded the source run:
./configure make make install
to install Node.JS, then run
make test
to run the tests.
[1] Official Node.JS build instructions: http://nodejs.org/#build
