Node.js

Node.js
Node.js
Node.js Logo
Original author(s) Ryan Lienhart Dahl
Developer(s) Node.js Developers
Stable release 0.6.2 / November 18, 2011; 4 days ago (2011-11-18)
Preview release 0.5.10 / October 21, 2011; 32 days ago (2011-10-21)
Development status Active
Written in C++, JavaScript
Operating system Mac OS X, Linux, Solaris, FreeBSD, OpenBSD, Windows (older versions require Cygwin), webOS
Type Event-driven networking
License MIT License
Website nodejs.org

Node.js is an event-driven I/O server-side JavaScript environment based on V8. It is intended for writing scalable network programs such as web servers.[1] It was created by Ryan Dahl in 2009, and its growth is sponsored by Joyent, which employs Dahl.[2] [3]

Similar environments written in other programming languages include Twisted for Python, Perl Object Environment for Perl, libevent for C and EventMachine for Ruby. Unlike most JavaScript, it is not executed in a web browser, but is instead a form of server-side JavaScript. Node.js implements some CommonJS specifications.[4] Node.js includes a REPL environment for interactive testing.

Contents

Examples

HTTP Server version of hello world 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://127.0.0.1:8000/');

Another example with a simple TCP server which listens on port 7000 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(7000);

Community

There is a very active Node.js developer community primarily centered on two mailing lists, nodejs and nodejs-dev, and the IRC channel #node.js on freenode. The community gathers at NodeConf, an annual developer conference focused on Node.js.[5]

See also

  • JavaScript
  • V8 (JavaScript engine)
  • NPM, the Node Package Manager - the predominant package manager for Node.js.
  • JSAN, the JavaScript Archive Network - a lesser used JavaScript package manager.

References

  1. ^ Wait, What's Node.js Good for Again?, By Klint Finley, January 25, 2011, ReadWriteHack
  2. ^ Why Everyone Is Talking About Node, By Jolie O'Dell, March 10, 2011, Mashable
  3. ^ Alex Handy (2011-06-24). "Node.js pushes JavaScript to the server-side". SDTimes. http://www.sdtimes.com/NODE_JS_PUSHES_JAVASCRIPT_TO_THE_SERVER_SIDE/By_Alex_Handy/About_JAVASCRIPT_and_NODEJS/35668. Retrieved 2011-09-04. 
  4. ^ Implementations/node.js - CommonJS Spec Wiki
  5. ^ NodeConf Schedule Announced, By Klint Finley, April 7, 2011, ReadWriteHack

External links


Wikimedia Foundation. 2010.

Игры ⚽ Нужен реферат?

Look at other dictionaries:

  • Node.js — Desarrollador Node.js Developers Inform …   Wikipedia Español

  • Node.js — Тип JavaScript интерпретатор Автор Ryan Lienhart Dahl …   Википедия

  • Node — (n[=o]d), n. [L. nodus; perh. akin to E. knot. Cf. {Noose}, {Nowed}.] 1. A knot, a knob; a protuberance; a swelling. [1913 Webster] 2. Specifically: (a) (Astron.) One of the two points where the orbit of a planet, or comet, intersects the… …   The Collaborative International Dictionary of English

  • Node.js — Développeur Ryan Lienhart Dahl et les développeurs de Node.js …   Wikipédia en Français

  • node — [nəud US noud] n technical [Date: 1300 1400; : Latin; Origin: nodus knot, node ] 1.) the place on the stem of a plant from which a leaf or branch grows 2.) a place where lines in a network cross or join 3.) a part of a computer network where… …   Dictionary of contemporary English

  • node — node. См. узел. (Источник: «Англо русский толковый словарь генетических терминов». Арефьев В.А., Лисовенко Л.А., Москва: Изд во ВНИРО, 1995 г.) …   Молекулярная биология и генетика. Толковый словарь.

  • Node —   [engl.], Knoten …   Universal-Lexikon

  • node — [ noud ] noun count * ▸ 1 where lines cross/meet ▸ 2 small lump in body ▸ 3 where leaf grows ▸ 4 where two parts meet ▸ 5 in computing 1. ) the place where lines cross or meet, for example on a GRAPH 2. ) MEDICAL a small lump in your body 3. )… …   Usage of the words and phrases in modern English

  • node — (n.) early 15c., a knot or lump, from L. nodus knot (see NET (Cf. net) (n.)). Originally borrowed c.1400 in Latin form, meaning lump in the flesh. Meaning point of intersection (originally of planetary orbits with the ecliptic) first recorded… …   Etymology dictionary

  • node — / nodule [n] knot, growth bud, bulge, bump, burl, clot, knob, lump, protuberance, swelling, tumor; concepts 471,831 …   New thesaurus

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”