Node.js

From Wikipedia, the free encyclopedia - View original article

Node.js
Node.js logo
Original author(s)Ryan Lienhart Dahl
Developer(s)

Node.js Developers, Joyent

StrongLoop
Initial releaseMay 27, 2009 (2009-05-27)[1]
Stable release0.10.25 / January 23, 2014 (2014-01-23)[2]
Preview release0.11.11 / January 29, 2014 (2014-01-29)[3]
Development statusActive
Written inC, C++, JavaScript
Operating systemMac OS X, Linux, Solaris, FreeBSD, OpenBSD, Windows (older versions require Cygwin), webOS
TypeEvent-driven networking
LicenseMIT
Websitenodejs.org
 
  (Redirected from Nodejs)
Jump to: navigation, search
Node.js
Node.js logo
Original author(s)Ryan Lienhart Dahl
Developer(s)

Node.js Developers, Joyent

StrongLoop
Initial releaseMay 27, 2009 (2009-05-27)[1]
Stable release0.10.25 / January 23, 2014 (2014-01-23)[2]
Preview release0.11.11 / January 29, 2014 (2014-01-29)[3]
Development statusActive
Written inC, C++, JavaScript
Operating systemMac OS X, Linux, Solaris, FreeBSD, OpenBSD, Windows (older versions require Cygwin), webOS
TypeEvent-driven networking
LicenseMIT
Websitenodejs.org

Node.js is a software platform that is used to build scalable network (especially server-side) applications. Node.js utilizes JavaScript as its scripting language, and achieves high throughput via non-blocking I/O and a single-threaded event loop.

Node.js contains a built-in HTTP server library, making it possible to run a web server without the use of external software, such as Apache or Lighttpd, and allowing more control of how the web server works.

History[edit]

Ryan Dahl – node.js creator

Node.js was created by Ryan Dahl starting in 2009. Its development and maintenance is sponsored by Joyent.[4] Dahl was inspired to create Node.js after seeing a file upload progress bar on Flickr. The browser did not know how much of the file had been uploaded and had to query the web server. Dahl wanted an easier way.[5] Ruby's Mongrel web server was another source of inspiration for Dahl.[6] Originally Dahl had several failed projects in C, Lua, and Haskell, but when Google's V8 engine was released, Dahl began to examine JavaScript.[7] Even though his original idea was non-blocking he "backed out of that (a bit) in the module system and a few other areas" as it made loading external libraries troublesome.[8]

On January 30, 2012 Dahl stepped aside, promoting coworker and NPM creator Isaac Schlueter to the gatekeeper position. Dahl wrote on Google groups,

Now that the rewrite on top of libuv is largely complete, I am ceding my position as gatekeeper to Isaac Schlueter. Our energy will now be largely focused over the next few months on improving the third party module system experience including a website for browsing modules, a new addon build system, and binary installations from npm. Isaac is in the unique position to bridge the gap between core and external modules to ensure a pleasant experience. After three years of working on Node, this frees me up to work on research projects. I am still an employee at Joyent and will advise from the sidelines but I won't be involved in the day-to-day bug fixes. Isaac has final say over what makes it into the releases. Appeals for new features, changes, and bug fixes should now be directed at him.[9]

Dahl continues to work for Joyent and as an advisor for node.[10]

On January 15, 2014 Schlueter announced he was making NPM his main focus and Timothy J Fontaine would be Node.js new project lead. Isaac wrote on the Node.js blog,

Over the last year, TJ Fontaine has become absolutely essential to the Node.js project. He's been building releases, managing the test bots, fixing nasty bugs and making decisions for the project with constant focus on the needs of our users. ... Anyone who's been close to the core project knows that he's been effectively leading the project for a while now, so we're making it official. Effective immediately, TJ Fontaine is the Node.js project lead. I will remain a Node core committer, and expect to continue to contribute to the project in that role. My primary focus, however, will be npm.[11]

The next day, January 16, 2014, Timothy J Fontaine made a followup post outlining the road ahead where he, among other things, mention bug fixing, performance tuning, staying up to date with V8 engine and tooling.[12]

Overview[edit]

There are four building blocks that constitute Node. First, Node encapsulates libuv to handle asynchronous events and Google’s V8 to provide a run-time for JavaScript. Libuv is what abstracts away all of the underlying network and file system functionality on both Windows and POSIX-based systems like Linux, Mac OSX and Unix. The core functionality of Node, modules like Assert, HTTP, Crypto etc, reside in a core library written in JavaScript. The Node bindings, written in C++, provide the glue connecting these technologies to each other and to the operating system.

Dahl's original goal was to create web sites with push capabilities as seen in web applications like Gmail. After trying solutions in several other programming languages he chose JavaScript because of the lack of an existing I/O API. This allowed him to define a convention of non-blocking, event-driven I/O.[13]

Similar environments written in other programming languages include Tornado and Twisted for Python; Perl Object Environment for Perl; libevent for C; Vert.x for Java, JavaScript, Groovy, Python and Ruby; Akka for Java and Scala; EventMachine for Ruby and vibe.d for D. Unlike most JavaScript programs, Node.js is not executed in a web browser, but instead as a server-side JavaScript application. Node.js implements some CommonJS specifications.[14] It also provides a REPL environment for interactive testing.

Examples[edit]

This is an implementation of a "hello world" HTTP server in Node.js:

 var http = require('http');   http.createServer(   function (request, response) {     response.writeHead(200, {'Content-Type': 'text/plain'});     response.end('Hello World\n');   } ).listen(8000);   console.log('Server running at http://localhost:8000/'); 

The following code is a simple TCP server which listens on port 8000 and echoes 'hello' upon connection:

 var net = require('net');   net.createServer(   function (stream) {     stream.write('hello\r\n');       stream.on('end',       function () {         stream.end('goodbye\r\n');       }     );       stream.pipe(stream);   } ).listen(8000); 

Tools and IDEs[edit]

Rohit

Community[edit]

Node.js has a developer community primarily centered on two mailing lists, nodejs,[15] nodejs-dev,[16] and the IRC channel #node.js on freenode. The community gathers at NodeConf,[17] an annual developer conference focused on Node.js.[18]

Node.js is currently used by a number of large companies including LinkedIn,[19][20]Microsoft,[21][22] Yahoo!,[23] Walmart[24] and PayPal.[25]

References[edit]

  1. ^ https://github.com/joyent/node/tags?after=v0.0.4
  2. ^ Node v0.10.25 (Stable)
  3. ^ Node v0.11.11 (Unstable)
  4. ^ Alex Handy (2011-06-24). "Node.js pushes JavaScript to the server-side". SDTimes. Retrieved 2011-09-04. 
  5. ^ Harris, Amber (April 1, 2012). "The Birth of Node: Where Did it Come From? Creator Ryan Dahl Shares the History". Devops Angle. Retrieved 26 October 2013. 
  6. ^ Synodinos, Dio (December 13, 2010). "Deep inside Node.js with Ryan Dahl". InfoQ. Retrieved 26 October 2013. 
  7. ^ McCarthy, Kevin (January 31, 2011). "Node.js Interview: 4 Questions with Creator Ryan Dahl". Streetwise Media. Retrieved 26 October 2013. 
  8. ^ Podsechin, Oleg (August 10, 2010). "Ryan Dahl Interview: Part 1". DailyJS. Retrieved 26 October 2013. 
  9. ^ Dahl, Ryan. "New gatekeeper". Retrieved 26 October 2013. 
  10. ^ Finley, Klint (January 30, 2012). "Node.js Creator Ryan Dahl Cedes Role as Gatekeeper to NPM Creator Isaac Schlueter". Silicon Angle. Retrieved 26 October 2013. 
  11. ^ Schlueter, Isaac (January 15, 2014). "The Next Phase of Node.js". Retrieved 21 January 2014. 
  12. ^ Fontaine, Timothy (January 16, 2014). "Node.js and the Road Ahead". Retrieved 21 January 2014. 
  13. ^ Hughes-Croucher, Tom; Wilson, Mike (2012). Up and Running with Node.js. Up and Running (1st ed.). Sebastopol: O'Reilly. p. vii. ISBN 978-1-4493-9858-3. "I was concerned about the ability to program advanced push features into the website like I had seen in Gmail" 
    See the book's Foreword at OReilly.com
  14. ^ Implementations/node.js - CommonJS Spec Wiki
  15. ^ http://groups.google.com/group/nodejs
  16. ^ http://groups.google.com/group/nodejs-dev nodejs-dev
  17. ^ http://www.nodeconf.com/
  18. ^ NodeConf Schedule Announced, By Klint Finley, April 7, 2011, ReadWriteHack
  19. ^ "You’ll never believe how LinkedIn built its new iPad app". VentureBeat. May 2, 2012. Retrieved May 10, 2012. 
  20. ^ [1], LinkedIn's developer blog discusses their Node.js stack optimizations
  21. ^ "Here's why you should be happy that Microsoft is embracing Node.js". The Guardian. November 9, 2011. Retrieved May 10, 2012. 
  22. ^ [2], WebMatrix - Front End Web Developers take note (ASP.NET, PHP, node.js and more)
  23. ^ [3], Yahoo! Developer Network announces Cocktails project using Node.js
  24. ^ "Why Walmart is using Node.js". VentureBeat. January 24, 2012. Retrieved May 10, 2012. 
  25. ^ "Clash of the Titans: Releasing the Kraken, NodeJS @paypal". fluentconf.com. May 28, 2013. Retrieved September 11, 2013. 

Further reading[edit]

External links[edit]