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

learn more… | top users | synonyms (1)

0
votes
0answers
7 views

NodeJS Tool to control request / response flux

I m actually facing a problem with my NodeJS api with a "Cant send headers after they are sent", in a special case. To bypass this and to check a bit deeper inside nodejs, I wanted to know if there ...
-2
votes
1answer
63 views

What do I need to parse sentence for a “simple bot” [closed]

I am developing a chat bot with Node.Js. I am trying to find efficient way to parsing sentence. what do you think about humanity -> ba bla bla. what do you think about cats ->I love cats ...
0
votes
1answer
106 views

Moving from C++ to NodeJS - Working with XML and JSON

I need to make a program to compare several large +100MB XML files, find the difference, and spit out JSON. I have written the comparison code in C++ and it performs great but now when I am getting to ...
1
vote
1answer
51 views

What is the purpose of separating routes into individual modules with Node.js and Express?

My app uses Node.js and Express 4 and has the following code in the app.js file located in the root directory: var express = require('express'); var index = require('./routes/index'); var users = ...
-3
votes
1answer
106 views

using node.js server with mysql-module and PHP for a penny-auction website? [closed]

I'm building a penny-auction platform like DealDash and just read into the WebSocket and node.js topic. I used PHP, MySQL and Ajax to build the website. I'm nearly finished and just have to implement ...
1
vote
1answer
117 views

Correct usage of Bluebird promise

This is related to this question on promise performance. The current top answer states that using new Promise is an anti-pattern in bluebird And that promisify should be used instead. I ...
-2
votes
0answers
13 views

Or operator is not working on String [migrated]

My nodejs code is not responding if (levelSpecificData.labelFont) if (levelSpecificData.labelFont !== "Arial" || levelSpecificData.labelFont !== "Arial Black" ...
0
votes
0answers
59 views

How to design a server that does not interrupt downloads?

I'm building a Node server that serves large files for download and streaming. It will be necessary to modify these files on occasion, sometimes in bulk with a script. I want to be able to update them ...
0
votes
0answers
100 views

Is this MEAN stack design-pattern suitable at the 1,000-10,000 user scale?

Let's say that when a user logs into a webapp, he sees a list of information. Let's say that list of information is served by one of two dynos (via heroku), but that the list of information ...
0
votes
2answers
53 views

Why should we expect user-space coroutines to be lighter than OS threads?

I have heard it said that managing concurrent TCP connections using user-space coroutines uses less resources per open connection than using an OS thread per connection. Actually, OS threads and ...
0
votes
1answer
49 views

Will simply adding a 'Allow Cross Origin Requests' to my node app work?

I'm trying to make a 'frontend web scraper'. I had the idea of setting up a node app that had a dynamic route that used Request (the NPM package) to scrape pages and displayed them as it's own. Then ...
0
votes
1answer
171 views

How to create a JSON or HTML file that dynamically mirrors file directory structure for jsTree 3.0 [closed]

I am looking to create a JSON OR HTML file that will accurately give the folder/file structure for a directory for use with jsTree 3.0 (www.jstree.com). I want to make it AJAX/lazy load so that each ...
1
vote
3answers
83 views

Executing scripts in parallel based on dependency tree

We have an app that is using a fairly simple stack (Linux, PHP, Oracle, Shell Scripts, etc). We have a series of scripts that need to be executed: /scr/app1/start.sh /scr/app2/start.php ...
2
votes
1answer
70 views

Is Current CoffeeScript Module Pattern Valid?

I have a Node.js web application that's written in CoffeeScript, which has a set of "services". These various services are currently exposed as a CoffeeScript class, which does a few things that I ...
1
vote
1answer
145 views

Assigning default values from environment variable in Node.js

When attempting to set default values for parameters that may exist in environment variables in JavaScript, I often see this pattern: var lag; try { lag = process.env.THROTTLE_LAG; } catch ( e ) ...
1
vote
0answers
87 views

Preserving Pre-formatted Multi-Line Strings in Node.js Scripts

There is a lot I don't like about PHP, but one thing I love is multi-line strings: $query = <<<EOT select field1 ,field2 ,field3 from tableName where field1 = 123 EOT; ...
-1
votes
1answer
100 views

How to connect mean.js to AWS S3

I am trying see how I can upload images and file to aws S3 via the mean.js framework. I am not sure how the backend is linked to S3. There are no resources online about this specific framework and ...
1
vote
0answers
28 views

Handling thousands of cassandra insert/updates

I have mobile app with backend server running in nodejs with cassandra as database. The app is like social network where you can share pictures and follow other people. Some operation like updating ...
1
vote
0answers
52 views

Help design this data import program

I want to import some data from various locations and pump it into MongoDb and some cloud services. The data starts off as JSON, I read that JSON, create some objects in mongo, go to the next level ...
5
votes
2answers
542 views

Where is the evidence for the performance of Node.js?

A lot of developers, especially ones who haven't used Node.js in production, seem to believe that Node.js is faster than other interpreted languages such as PHP, Python, and Ruby. These claims ...
0
votes
1answer
94 views

Should I prefer classes or singletons in JavaScript/Node?

This question applies especially to Node.js, but also to JavaScript in general. I started working on a simple web app in Node.js. I'm relatively new to Node and JavaScript, and come mainly from C# ...
0
votes
1answer
28 views

Image uploads - preoptimize with CDN or host on same machine?

I'm working on a personal blog that will be used for reviewing various goods/services and as a dev journal. I'm writing this in Angularjs and Nodejs as a learning experience, but I plan on using it ...
-5
votes
2answers
170 views

Turn on gzip on nginx, upstream (nodejs) or both? [closed]

I have a nodejs app runing behind nginx. What do you think is a better setting for compression and performance, turning on gzip on: upstream/nodejs proxy/nginx both EDIT: I have a application ...
1
vote
2answers
143 views

How can I ensure my JavaScript code will run in both Node.js and Io.js [closed]

With the danger of fragmentation due to the fork in Node, how can I make sure a "Node" project will run across both Node and its fork? The hope is that they will join together again once Joyent and ...
1
vote
0answers
162 views

Separation of web server and stateless REST API

Currently, I have a single Node server that provides both (a) stateless API routes returning JSON, and (b) session-based web routes. My API routes and web routes have started sharing a lot of code, ...
0
votes
0answers
124 views

vert.x message bus architecture

A large part of the vert.x architecture is around the message bus, and message passing between verticals. The main idea I guess being that I can create multiple modules (possibly in multiple ...
1
vote
1answer
53 views

Compose nested EventEmitters elegantly

I am developing a server-side JavaScript tool, and trying to do so in a modular way. I have a Parser class that is an EventEmitter - you call parse and it will eventually emit data and end events. It ...
3
votes
1answer
291 views

What is the best way to format complex SQL queries in Node?

I am using node-mysql to query a MySQL database via Express and Node. My queries are getting fairly complex and I want to format them across multiple lines. However, the only way I could accomplish ...
-1
votes
1answer
75 views

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 ...
2
votes
1answer
134 views

Callback functions: Semantics and maintainability, when they aren't necessary [duplicate]

Within the context of JavaScript/Node.JS; Will using Callback functions improve the maintainability of source code, when there is no need for async programming? For example does the plain code sound ...
1
vote
2answers
94 views

Why is it bad if view engines encourage logic in templates

I once read this, because I wanted to see if handlebars is the right view engine for me or rather something else. A thing that I wonder since then is the following, why is it considered bad, if a ...
0
votes
0answers
139 views

Node.js, Client side web cache [on hold]

So, I am not expert at Node.js, but from what I was looking at with Node.js it seems possible. I am trying to cache data (A and B below) on the client (client 1 below) so that I can get that data on ...
2
votes
1answer
277 views

NodeJs website webapp architecture

I would like some advice on how best to architect a website comprising the following: tool a landing page, open to the public, main marketing tool the main website/app, that people can access only ...
0
votes
0answers
57 views

How to define dependent function in node js?

I have a nodejs project in which a sample.js include two function function A depends on function B's callback . // smaple.js Both function are included in the same file function B ( ...
0
votes
0answers
335 views

Unit Testing: Pass in Modules or Entire Codebase?

In unit testing, the idea is (I think, correct me if I'm wrong) to unit test a module, then integration test these modules together, then integration test the respective "regions" of modules you ...
0
votes
1answer
211 views

Create fake HTTP server to simulate an API for testing

I'm looking to mock responses from an external API service that returns JSON during live events. The first response would contain (fake) events that have happened up to time X, the second response ...
1
vote
1answer
1k views

Erlang chat app design?

I have a chat app made in node/socket.io. Scalability factors have made us choose Erlang/Ejabberd/xmpp and it will replace node/socket. I have a few questions: Currently using MySql for chat ...
3
votes
1answer
160 views

Is my websocket session idea practical?

In a situation where all communication (including logging in) between a client (web browser) and server is done over a persistent TLS encrypted websocket, would there be anything inadvisable about ...
1
vote
1answer
963 views

Node.js on Apache server (Shared Hosting)

I would like to run Node.js/Express as a backend server mainly for handling WebRTC features in my app. I was just discussing this with my hosting provider and they rejected this request saying that ...
0
votes
2answers
157 views

In Node.js, are non-blocking constructs usually preferable to blocking ones?

Is the following a statement of best practices in Node.js with regard to web applications? If not, how could it be improved? The statement The lifecycle of any web app has at least two phases: a ...
0
votes
0answers
185 views

Is this right in the use case of exec method of child_process? is there away to cody the envirorment along with the require module too?

I'm learning node. I am using child_process to move data to another script to be executed. But it seem that it does not copy the hold environment or I could be doing something wrong. To copy the hold ...
4
votes
1answer
138 views

Are promises suitable for Model Controller communication?

I have an Express app built with the Yeoman Angular fullstack generator to build an API to send JSON to Angular. I'm trying to work out the best way to pass back information from my model to my ...
5
votes
3answers
489 views

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) { ...
0
votes
4answers
389 views

Is client side JavaScript capable of replicating the Node.JS module loading system?

I like the Node.JS style of JavaScript, where I can write all of my functionalities into smaller files and then require those neatly from within my code. I'm even thinking about trying to write a ...
0
votes
1answer
208 views

How to tell node.js which javascript code runs on server vs client?

I am trying to learn the theory of node.js but can't seem to figure out how node.js knows whether to pre process it on the server or send it to browser for execution.
4
votes
1answer
142 views

Testing gap between unit and integration: Integration in the Small, Component, Unit Integration Tests

Over the past few weeks I've been mulling and researching how to fill a gap in our testing methodology. In simplified terms unit tests are too small and traditional integration tests are too big. A ...
2
votes
1answer
92 views

Wrapping function in closures to make testable functions

In my nodejs project, I have functions like this for socketio. socket.on('draw', function (data) { socket.broadcast.to(socket.room).emit('draw', data); addEvent(socket, ["draw", data]); }); ...
0
votes
2answers
208 views

confusion on using nodejs within an actual web application or ide

I am new to using nodejs completely, and it seems to be pretty much the go to thing for everything right now. But I program in Visual Studio, and I'm a bit confused about how this works. I will cite ...
3
votes
2answers
101 views

How to handle versioning with multiple independent pull requests in a Git repository?

Let's say Alice has a Git repository, and the version is kept track of inside the repository (let's say package.json for npm). Bob sends a pull request to Alice which increments the version number ...
-2
votes
1answer
175 views

Would you get better performances by coding an application in C, then compile to JavaScript? [closed]

I am writing an interpreter for a functional programming language that is going to run in the browser. Needless to say, performance is the one and only concern in this application. Emscripten is an ...