Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 362
Clive Avatar asked Jun 01 '11 20:06

Clive


People also ask

Why are closures useful?

Closures are useful because they let you associate data (the lexical environment) with a function that operates on that data. This has obvious parallels to object-oriented programming, where objects allow you to associate data (the object's properties) with one or more methods.

Why do we need JavaScript closures?

In JavaScript, closures are the primary mechanism used to enable data privacy. When you use closures for data privacy, the enclosed variables are only in scope within the containing (outer) function. You can't get at the data from an outside scope except through the object's privileged methods.

What is the point of node JS?

Node. js is primarily used for non-blocking, event-driven servers, due to its single-threaded nature. It's used for traditional web sites and back-end API services, but was designed with real-time, push-based architectures in mind.

Is node js going away?

The short answer is “NO.” The long answer is, “NO, it's not dead, and it probably will never die.” Node. js is just as relevant to coding in 2021 and beyond, even if the hype around it has stabilized slightly.


2 Answers

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

:)

like image 63
slezica Avatar answered Oct 11 '22 14:10

slezica


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?
like image 23
Raynos Avatar answered Oct 11 '22 12:10

Raynos