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
2answers
68 views

Middleware dependencies

I'm trying to convert a legacy PHP app to use the middleware paradigm, similar to connect/express.js. I've started porting the code into separate middlewares so that every feature is neatly self ...
-4
votes
0answers
10 views

How to add custom view to markers located on a map?

I have been working around with a store locator application built using JavaScript. I am able to locate the stores on the map but how to add a custom view to the markers of the stores so that when an ...
0
votes
0answers
20 views

Synchronizing content between web-based app and game server

I have a MUD server, written in C, that I'm trying to move from file-based storage to MongoDB. Eventually, I'd like to offload administration of game content and settings to a web console, written in ...
-2
votes
0answers
28 views

Setting up Visual Studio for 2013 for Angular.js and Node.js development [on hold]

I want to start development with Node.js for my server side logic and AngularJS for my client side logic. I want to develop in my favorite IDE: Visual Studio 2013. However, I can't find any ...
2
votes
1answer
77 views

How to design a serverside heartbeat with nodejs?

I would post this on http://stackoverflow.com/, but figured I am not looking for code, just an idea how to accomplish this. I have a gameserver that interacts with nodejs and uses the websocket ...
1
vote
0answers
25 views

Proper usages of rooms/namespaces when making a News Feed with socket.io

I am working on making a News Feed for a piece of software that will have data posted to different hierarchical levels within the software. For example, the software will support multiple ...
-1
votes
0answers
19 views

Node js keyword search [closed]

I am making a Node JS application and one of the functionality is to search a text against a set of keywords to see if this text has one. The search can have options like matching case or whole word ...
1
vote
0answers
67 views

Is it a bad practice to compile TypeScript NodeJS app to a single JS file?

I'm currently exploring TypeScript and I was wondering why not compile the whole app to a single JS file instead of compiling every .ts file to it's corresponding .js. Example for such an app is ...
-1
votes
1answer
29 views

can i use json file as a module in node.js [closed]

i have a json module which contains empty containers like this { "files":{ "rootNeeded":[], "folders":[], "files":[], "images":[], "text":[], "unknown":[] }, } and i wonder if i can push ...
-1
votes
1answer
19 views

Looking for a node library that can help find string similarities [closed]

For example, I have the strings "Bat", "Spider", "Alien" as my data, and I feed the string "Batman" into a function. I'm looking for a module that would compare the similarity between the input string ...
0
votes
1answer
33 views

node deep file indexer module cannot go deep [closed]

I'm trying to make a file indexer by node.js. The program is supposed to index files and folders in an array and also check inside folders and add all sub folders and files I wrote: ...
0
votes
0answers
9 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 ...
0
votes
1answer
119 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
61 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
143 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
156 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 ...
0
votes
0answers
61 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
108 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
55 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
64 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
230 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
106 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
82 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
185 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
105 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
104 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
36 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
580 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
102 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
196 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
146 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
209 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
133 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
56 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 ...
4
votes
1answer
347 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
80 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
141 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
100 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 ...
2
votes
1answer
290 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
59 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
349 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
217 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
179 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
1k 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
160 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
195 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
140 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 ...