Linux Symposium

JavaScript beyond the Web: an Introduction to Node.js

Andrew Clunis

Node.js is a Free Software project that takes the performant V8 JavaScript runtime from Google, and builds a system programming environment around it reminiscent of the Ruby or Python runtimes. A particularly important concept is the promotion of a single main event queue implementation to a first-class language facility, as it is when JavaScript lives in its original home, the web browser. They add a core library (CommonJS- derived, with some very nice integrated networking libraries added), library loading facilities, with various bits of community contrib available such as a package manager (not unlike gems) and a pile of libraries and projects. It's proving quite useful for writing fast event-driven network applications in a dynamic language, and in particular includes an excellent HTTP library making it more possible for web developers to innovate directly on top of the HTTP protocol.

The JavaScript language itself has only lately garnered recognition as a capable language suitable for Real Work only within the last few years, with the emergence of community lore (far beyond that of the uninspired copypasta of old), patterns, and actual projects making it an increasingly viable option. JavaScript has been of particular interest to Rubyists for a while, due in part to its similar capabilities with late binding and lexical scoping (closures), and increasingly obvious relevance in the world of web development. This tutorial will include a quick introduction to the JS language and its history, and an introduction to the node.js environment itself (installation, invocation, and the core libraries), and will guide participants through building a simple network application with it.

In order to follow along, please bring a laptop with node.js already built and installed. It doesn't have many dependencies. However, please don't use distro packages (yet).

Policies   |   Media Archives