Jump to content
jimfog

Node.js

Recommended Posts

the question is simple the answer though may not be:is node.js there to replace (php for example) or to "plug some hole" in the existing web technologiesis it just an addition to our arsenal(js,php...) or something more than that?

  • Like 1

Share this post


Link to post
Share on other sites

I don't know what node.js is. Is it some Javascript library you obtained? People make libraries to shorten and simplify Javascript tasks.

Share this post


Link to post
Share on other sites

Node.js is an I/O based concept written in javascript, binded to V8. http://nodejs.org/ It can be an alternative to the typical server software like Apache and makes exclusive use of Javascripts event oriented nature, dubbed the event loop. I have played around with it a little but not to the point of installing it on a server. I would consider it a tool and alternative. There are also some really good videos about it on YUI theater.

I've used it in conjunction with Mocha as a way to run unit tests purely in Javascript in the hopes of not having to rely in MVN/JUnit/Rhino to write and run our tests, since for these given project, since they are written in javascript. The long story is that we hope to be able to automate testing with Mocha as an alternative. I can understand Java, but it would be more intuitive for me if I could write my tests in Javascript though.

Share this post


Link to post
Share on other sites
Node.js is an I/O based concept written in javascript, binded to V8. http://nodejs.org/ It can be an alternative to the typical server software like Apache...
So it is an alternative to Apache you are saying and not PHP, correct?

Share this post


Link to post
Share on other sites

I have also been confused about the big hype about Node.js and its relatives. I think I'm slowly getting it though...

Share this post


Link to post
Share on other sites

It's more about what Node is doing (I/O), rather than what it is (effectively server side javascript). Javascript is used in lots of places other than web browsers. I use it to write iTV applications at my work, where the HTML is essentially a form of XML specifically for this proprietary system. What Node is doing is applying the concept of an event loop to handling requests on a server, rather than a queue. This is a pretty cool concept, and it's because of javascripts syntax and nature that is can used that way, because events are arguably the core of javascript, and along with it come callbacks, lamda's, and anonymous functions. very useful for this particular implementation.

Edited by thescientist

Share this post


Link to post
Share on other sites

Yes, but is it aiming to replace PHP, Ruby etc... or just to supplement them?

Share this post


Link to post
Share on other sites
http://en.wikipedia.org/wiki/Nodejs
Node.js is a software system designed for writing highly-scalable internet applications, notably web servers.[1] Programs are written in JavaScript, using event-driven,asynchronous I/O to minimize overhead and maximize scalability.[2] Node.js consists of Google's V8 JavaScript engine plus several built-in libraries.
it has it's own API and can do the things it was designed to do. I imagine it could work with other languages, but I can't say I've tried.http://nodejs.org/docs/latest/api/index.html Edited by thescientist

Share this post


Link to post
Share on other sites

well, I conversed with one of co-workers and got to the bottom of it:

Yeah. So, if you are asking about the server stack, You don't need Apache or PHP. You have V8, which runs the JS, and you have Node, which gives you the API, and you have your server code, which you run on V8 via Node. Most of what you got for free with Apache, you will need to build or find and install for yourself.
So I guess in summary it's more of a networking solution, allowing for more responsive applications that aren't bound to the conventional queue based I/O paradigm.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...