Questions tagged [node.js]

Node.js is an event-based, asynchronous I/O framework that uses Google's V8 JavaScript engine.

Node.js logo

Node.js is an event-based, asynchronous I/O framework that uses Google's V8 JavaScript Engine.

Node.js — or just Node, as it's commonly called — is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-usability of code and the lack of context switching.

It's also possible to use matured JavaScript frameworks like YUI and jQuery for server-side DOM manipulation.

To ease the development of complex JavaScript further, Node.js supports the CommonJS standard that allows for modularized development and the distribution of software in packages via the Node Package Manager.

Applications that can be written using Node.js include, but are not limited to:

  • Static file servers
  • Web Application frameworks
  • Messaging middleware
  • Servers for HTML5 multi player games

When asking questions about Node.js, you should:

  1. Make sure to check the official API documentation before asking, your question might be trivial.
  2. Isolate the problem and reproduce it with as little code as possible, if you can also use an online tool like JSApp for that, it's even better.
  3. If the question has nothing to do with anything that's Node.js specific, please consider asking it as a question instead.
  4. Mention which version of Node.js you are running. When in doubt, use node -v.
  5. Make sure to only use the tag, since is ambiguous.

Interesting Questions and Answers

Useful Links

Tutorials, Guides and Books

Talks and Presentations on Node.js

Free Node.js Books and Resources

Chat Room

  • Chat about Node.js with other Stack Overflow users here
500 questions
15
votes
1 answer

How to deal with asynchronous functions when you really just want things synchronized

I am fairly new to NodeJS and I'm having a hard time wrapping my head around the asynchronous nature of functions when I really want one call to follow the other in a synchronized way. Say for instance I am calling web service methods. Every method…
10
votes
2 answers

How does one serve content with node.js without requiring a framework or library?

I'm trying to learn node.js and create a web application, and although I'm doing my best to just use only node.js to create it, I'm having a very difficult time finding resources and examples that describe the process without using other frameworks…
7
votes
1 answer

Why do req.params, req.query and req.body exist?

I'm new on Node.js and Express and now I'm observing that when I change the method on my calling app the params are in req.param([name]), req.body.[name] or req.query and it depends by the method. Now my questions are two: Are there some…
7
votes
1 answer

Best practice for multi-module design local dependencies

This question may have been asked before and if so feel free to link to the answer. I'm looking for a modern and effective recipe for a common problem. I have a project with a main module, A, that depends on another module, B, that I develop…
Cliff
  • 171
6
votes
1 answer

Node.js and CPU intensive web applications

Some time ago I made this question about porting a Silverlight application to web. We lack experience working with web applications and have started to look for training and resources. We have noted that there is a strong trend about Node.js at the…
MACN
  • 185
  • 1
  • 1
  • 5
6
votes
3 answers

The nature of callbacks in Node.js

In the plain javaScript world I've learned that nested functions can be problematic because the inner function is "re-created" every time the outer function is called: function outer(a) { function inner(arg1,arg2){ return arg1 + arg2; …
Dave
  • 253
6
votes
3 answers

Real performance of node.js

I've got a question concerning node.js performance. There is quite lot of "benchmarks" and a lot of fuss about great performance of node.js. But how does it stand in real world? Not just process empty request at high speed. If someone could try to…
Jarek
  • 241
  • 3
  • 4
5
votes
2 answers

Using Node.js with Heroku to make a chat server?

I currently have a goal of creating a sort of chat website. I just finished trying with PHP and long polling, which hit a resource limit on my webhost's server. I was told that I should use Node.js and that it can be hosted with Heroku. I honestly…
mowwwalker
  • 1,159
  • 2
  • 12
  • 20
4
votes
3 answers

How can I implement real time gameplay when a user isn't online?

I have two questions about keeping timers running (like growing crops in Farmville) when users are not online: Am I right in thinking that I should just calculate what would have happened when the state is requested, rather than actually running…
4
votes
1 answer

What are Some Real World Usage Scenarios for node.js

i would like to begin tinkering with Node.js but i am unsure of some "Real-World" situations where node.js would be considered the proper thing to be used. The last thing a developer wants is to learn a new technology and use it in-properly.. Can…
NDBoost
  • 183
  • 8
2
votes
2 answers

Is node.js for algorithmic problems like TSP or graph coloring or exact cover problem a good decision?

I read on node.js's official site that Node.js is a JavaScript run time built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O mode and highly scalable for network applications. And some thread I read that it is not…
2
votes
1 answer

Is there a convention about the standard port for testing and developing in node.js?

I'm trying to get started with node.js. For example en Java and .net programmer often use the port 8080? Is there a convention like that in node.js? I know that any port above 1024 will do it but I will like to follow the conventions so working with…
MarcDvs
  • 37
  • 1
  • 2
1
vote
2 answers

Will pre-loading a small file in Node.js significantly improve web server efficiency?

When responding to an HTTP request for a commonly used file on my web server, for example index.html, rather than reading the file each time, I list those popular resources in an array and read them when the server starts, so for all requests those…
J.Todd
  • 3,823
1
vote
0 answers

Best way to set up a dev environment for Node.js using AWS s3?

We are getting ready to port part of our app over to node.js, and are looking for a way to support s3 uploads and testing in our development environment. Right now we are thinking about setting up test buckets (ie 'myProductionBucket-test'),…
coleMan
  • 11
1
vote
2 answers

Can I use Node to add email functionality to an existing site?

I have a client with an existing straight up HTML/JavaScript site. No back end of any kind. He wants to add email functionality to it and I was thinking of using Node to do this for two reasons: It seems like an extremely lightweight way to do…
KevDog
  • 962
1
2