What is the point of Node.js [closed]
Ok this is probably a little blunt and to the point, but what is the point/need for Node.js
I've noticed it mainly through CloudFoundry but just not too sure what its supposed to be doing. However I am guessing its probably something pretty big as why else would VMWare be supporting it.
Thanks in advance.
It's an...
- Efficient and 100% event driven IO framework,
- flexible enough to use the best underlying OS features it can find,
- presenting an API in a high-level programming language (the same language your client-side will most-likely use),
- implemented on top of the best available intepreting engine for that language, and
- supporting more and more third party libraries with each passing day.
- Effecient in server side api, avoid using for CPU intensive operation
:)
Node.js does IO right. It's asynchronous and non-blocking and the beauty of using js is that it does not have a standard blocking IO.
It's fast (v8 is a beast), it scales well, It's got a vibrant community and it's popular.
There are lots of wonderful libraries that run on node like now
and socket.io
.
It excels at real time communication and highly concurrent websites.
It also has the added bonus of less code duplication. You can write the same MVC code on the client as the server and easily support non-js users.
Further reads:
- Usages of Node.js - What obstacles is it aiming to provide a ramp for?
- Why and when to use Node.js?
- What so different about Node.js's event-driven? Can't we do that in ASP.Net's HttpAsyncHandler?
- What is Node.js?
Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications.
The node.js tag has some more background information to point you in the right direction: https://stackoverflow.com/tags/node.js/info
Node leverages Javascript's first class functions to allow you to program the server in a dynamic scripting language while getting very competitive performance.
Node isn't as fast as Haskell, Erlang or Go. But it is competitive with Java, and it outperforms Ruby, Python and PHP.
Haskell, Erlang, Go, Java, Ruby, and Python all have evented IO webframeworks, but they also have blocking libraries to serve as pitfalls.
Despite it's warts, Javascript is the lingua franca of the web and since browsers are evented, not only is Javascript built for evented style programming, most web developers are used to writing evented Javascript.
Also check out this register article: http://www.theregister.co.uk/2011/03/01/the_rise_and_rise_of_node_dot_js/
This post might help:
Why Developers Should Pay Attention to Node.js
精彩评论