[ Impressum ]

Node.js

www.Rozek.de > Node.js
Primarily, Node.js [1] is a platform for extremely powerful network applications written in JavaScript. However, in combination with other technologies (such as Node-WebKit [2]) Node.js may also be used for more than just HTTP servers.

Overview

  • SimpleCGI - a simple CGI interface for Express.js [3]

Installation of Node.js itself

If you have not already done so, you may download an installer for your platform from nodejs.org. Simply run this program in order to install Node.js on your own computer.

To verify the installation, just enter the following command on the command line

node --version

The output of this command should reflect the installed version of Node.js, e.g.:

v0.10.25

An output of this form indicates that Node.js is working properly.

Installation of Node.js Packages

Along with Node.js itself, the Node.js package manager npm is installed as well: for Node.js, there are numerous additional packages that extend the functionality of Node.js considerably - these packages are usually installed using npm.

npm knows two basic installation modes: local and global.

The local installation of a packet takes place in a subdirectory called node_modules, which (if not already present) is created in the directory, from which the npm command was invoked. Afterwards, the package is available to all Node.js scripts, which were also started from this directory (or one of its subdirectories).

In contrast, a global deployment installs into an (operating system dependent) location in the file system which is accessible by all Node.js scripts: thus, globally installed packages are available to all Node.js applications.

If you only want to test a given packet, you should initially install it locally only:

npm install <package-name>

Once you are sure that this package should be available everywhere, it can still be installed globally:

npm install --global <package-name>

Everything else can be found in the documentation for npm.


Have fun with Node.js!

Bibliography

[1]
Joyent Inc.
node.js
Node.js is first and foremost a platform for extremely powerful network applications written in JavaScript. However, in combination with other technologies (such as Node-WebKit) Node.js may also be used for more than just HTTP servers.
[2]
Roger Wang
node-webkit
Node-WebKit is a runtime environment for desktop applications written with HTML 5, CSS 3 and JavaScript which can escape a browser's sandbox and access the system environment thanks to Node.js.
[3]
Tj Holowaychuk
Express - node.js web application framework
Express is a lightweight web application framework for Node.js. Thanks to its modularity, Express allows for rapid development of HTTP servers based on Node.js.