5

I am a web developer writing a lot of code in jquery.

I am trying to learn YUI3 and I notice the 'node' module there. I also heard about something called Node.js. Are the YUI3 node module and Node.js related ?

The official Node.js website does not seems to have much info.

What exactly is Node.js? It is server-side does that mean we can used Node.js instead say PHP ? What kind of applications are being developed using Node.js?

Is it worth for a web developer to invest time learning this ?

Eastern Monk
  • 6,395
  • 8
  • 46
  • 61
  • 1
    There is this great techtalk given by Ryan Dahl (father of Node.js) at Google: http://www.youtube.com/watch?v=F6k8lTrAE2g. – Amokrane Chentir Feb 15 '11 at 19:50
  • Related question http://stackoverflow.com/questions/1884724/what-is-node-js – rubayeet Feb 15 '11 at 19:52
  • The two (the YUI `node` module and Node.js) are completely unrelated, but Node.js is still pretty cool and worth at least glancing at. And Node.js and PHP aren't directly comparable--Node.js is an entire server framework, whereas PHP is simply a language used for developing web applications. – Sasha Chedygov Feb 15 '11 at 20:09
  • No relationship except that a lot of buzz was generated by the demonstration of pages with a YUI Calendar widget rendered server-side in a simulated browser environment using node.js + JSDOM. The node module of YUI3 is not related to node.js, that's just a coincidence. – Eric Bréchemier Feb 16 '11 at 13:38

3 Answers3

1

Node.js is an evented I/O JavaScript server platform. It makes it relatively easy to create things like sockets and quickly handle many concurrent connections.

Node is similar in design to and influenced by systems like Ruby's Event Machine or Python's Twisted. Node takes the event model a bit further—it presents the event loop as a language construct instead of as a library. In other systems there is always a blocking call to start the event-loop. Typically one defines behavior through callbacks at the beginning of a script and at the end starts a server through a blocking call like EventMachine::run(). In Node there is no such start-the-event-loop call. Node simply enters the event loop after executing the input script. Node exits the event loop when there are no more callbacks to perform. This behavior is like browser javascript—the event loop is hidden from the user.

About Node.js

Josh K
  • 28,364
  • 20
  • 86
  • 132
1

Node.js is actually a JavaScript framework for asynchronous servers. It runs server-side, rather than client-side like the YUI3 widgets library, and, chances are, if you don't need to roll your own high-performance evented sockets/asynchronous HTTP/etc. server and are just looking to write run-of-the-mill websites, then there is no need to learn Node.js.

(that said, Node.js is still pretty cool.)

1

the biggest connection between YUI3 and node.js is yeti

a command-line tool for launching JavaScript unit tests in a browser and reporting the results without leaving your terminal.

generalhenry
  • 17,227
  • 4
  • 48
  • 63