-1
votes
1answer
84 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 ...
0
votes
2answers
114 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 ...
3
votes
0answers
90 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 ...
0
votes
4answers
186 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
141 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.
-3
votes
1answer
136 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 ...
2
votes
0answers
62 views

Managing setTimeouts and setInterval in a distributed environment

I am building a turnbased game on nodejs using socket.io and redis as the datastore. I am planning on hosting the game on AWS opsworks with the ability to scale by adding more nodes. How should I ...
3
votes
1answer
225 views

How significant is node's advantage of training developers in only one language and putting them on tasks across the tech-stack? [closed]

I have recently joined a startup as CTO/co-founder. The startup and I have been thinking about moving the existing codebase (which is in PHP5.5, laravel framework) to node.js . Main reason for this ...
2
votes
1answer
435 views

How can I keep Web services requests in a DAO layer without tying the code to the DOM?

I'm working on a single page application on the node-webkit desktop app platform, which means 99.9% of all of the logic is written in JavaScript. Since this is a reboot of a project we're working on, ...
1
vote
2answers
588 views

Developing a dynamic site with Node.js [closed]

I'm trying to get some pointers on what the best methodology to follow for a web application would be. First, some background: I've built two different APIs using Node.js where Node serves the data ...
1
vote
1answer
201 views

Is parsing a submitted JSON object safe?

I have a RESTful API, built in NODE.js that does what you would expect it to: consumes data and then makes it accessible. Currently, data being submitted to my server is nested form data: ...
0
votes
2answers
1k views

Understanding Front End vs Back End Javascript?

I've been noticing lately, as I've played around with javascript, HTML5, and node.js for the first times that javascript seems to be a language that is used very differently (and with different ...
2
votes
4answers
649 views

Call the database every time, or create an object in memory, and if so, how and how often to update?

I'm creating an app in javascript/nodejs and using neo4j as database. Let's say I have an entity User in my database. It has a bunch of properties, like boxes_collected and places_visited, which keep ...
0
votes
3answers
2k views

Are (mostly) client-side JavaScript web apps slower or less efficient?

I am in the midst of writing a web application for work. Everything is from scratch. I have been a PHP programmer for about 13 years, Node.js programmer for the past 2 years, and have no shortage of ...
15
votes
3answers
2k views

Novice to node.js, what is the advantage gained using callbacks over events?

I am a novice JavaScripter and have no real knowledge of what goes on inside the V8 engine. Having said that, I am really enjoying my early forays into the node.js environment but I find that I am ...
-3
votes
1answer
381 views

Real-World node.js [closed]

I am 14 years old, and have been studying web/app/software development. I am trying to learn a backend language, and am considering node.js. I have heard awesome things about it, plus I like that fact ...
6
votes
4answers
4k views

Is node.js a good fit for background processing?

I'm slowly learning node.js and have a small project I want to start. The project will have a lot of background processes (downloading data from external sites, parsing CSV files, etc.). A big "win" ...
0
votes
1answer
353 views

Sync csv file using nodejs

There is a remote csv file that gets updated every second or so. I need to download it(on a Windows machine) ONCE and always sync local file with the remote one. Obviously, downloading the whole ...
-2
votes
2answers
3k views

Is Node.js future-safe? [closed]

I've been getting great results with Node.js since a year+. Everything is perfect and I couldn't be happier. Yet I have a feeling that this model won't last long and will be forgotten as soon as ...
3
votes
3answers
5k views

flow control solutions in Node.js - use async.waterfall?

Looking at node.js, and avoiding nesting callbacks. I found Async.js, can someone show me how can I rewrite this code using the async.waterfall method? // db is a mongodb instance ...
13
votes
3answers
3k views

What determines which Javascript functions are blocking vs non-blocking?

I have been doing web-based Javascript (vanilla JS, jQuery, Backbone, etc.) for a few years now, and recently I've been doing some work with Node.js. It took me a while to get the hang of ...
9
votes
1answer
2k views

How can NodeJS be “non-blocking”?

I'm learning NodeJS and just wanted to clarify something. In several introductory tutorials and books so far, very early on they've described Node's "non-blocking" architecture - or rather that it's ...
5
votes
2answers
408 views

Please explain object versioning in the nodejs module system

This question is about the persistance of variables across different modules in nodejs when they don't directly "require" each other, but do "require" a common ancestor. It is also the generalised ...
5
votes
1answer
1k views

Is Node.js correct choice for JSON parsing and IO driven

My program should perform following task: It listen on http port after getting request it does following things. Connect to gearman Parse gearman payload to JSON (Upto 100 bytes) Connect to Redis ...
1
vote
2answers
366 views

Single codebase for client and server with Node.js [closed]

There are a few claimed benefits to Node.js that I typically hear. Some (many?) I agree with. There is one that I completely do not understand, which is the one language argument: "You can now use one ...
0
votes
2answers
180 views

Strategy for reading and understanding Node.js code [duplicate]

Concretely I am looking at this 2000 line file of what I will pretty arbitrarily call "mediocre" code. It's not well-commented variable names and function names seem consistently intelligent ...
3
votes
1answer
193 views

Idiomatic Javascript code architecture

I am writing a node.js application which I am breaking down into modules, the issue is I am not sure how to organise my code in an idiomatic Javascript way. Currently each of my modules exposes a set ...
4
votes
1answer
2k views

Node.js app private modules. Where to put them?

The situation would be: I develop 2 projects in my Node.js development environment, P1 and P2. P1 required the development of two simple modules, mod1 and mod2, which are stored in P1/lib. Each one ...
3
votes
4answers
966 views

NodeJS as an avenue towards learning JavaScript [closed]

I'm a backend programmer who works mainly in Python. I'll probably never want to be a full time front end developer, but with the goal of growing my skill set, I would like to become at least passably ...
17
votes
2answers
21k views

A good IDE for NodeJS - debugging especially important [closed]

Have a significant amount of a Data Warehousing application written in Javascript. The application is set up so that the Javascript code runs in a web browser (Chrome). Of course, running a Data ...
4
votes
5answers
1k views

Why do node packages put a comma on a newline?

I'm learning node.js and am trying out Express. My first app had this code: var express = require('express') , routes = require('./routes') , user = require('./routes/user') , http = ...
1
vote
2answers
1k views

Synchronous sockets with Node.js

I want to port an existing app from Java to Node.js - would like to seek your advise. The java app is a multithreaded socket server where arbitrary number of clients can connect. The app runs on java ...
5
votes
1answer
4k views

Node.js Or servlets?

I have heard a lot and read about the Javascript server side language i.e Node.js, and saw many comparisons in favor of Node. I don't understand what makes it better or faster, or how it even relates ...
1
vote
1answer
315 views

2 Servers 1 Database - Can I use Redis?

Ok I have a couple of questions here. First let me give you some background information. I'm starting a project where I have a node.js server running my application and my website running on another ...
4
votes
1answer
159 views

How secure (or insecure) is it to install Node packages globally?

Should I be concerned with security when installing Node packages globally? Why or why not?
4
votes
5answers
5k views

easiest way for push notifications

I wanted to implement real time push notification to one of the apps written in RoR. I don't have any experience with nodejs, nowjs, express or socketio. What would be the easiest way to implement ...
0
votes
2answers
439 views

arrays format (Javascript)

I have a list of users, with minions, something like this: User52: minion10 minion12 User32: minion13 minion11 I've been keeping in an array where the "location" is the ...
3
votes
1answer
1k views

mysql, one connection vs multiple

On nodejs with node-mysql, should I create one connection for the service like this: var client = mysql.createClient({ user: 'user', password: 'pass' }); // Create a new mysql Client ...
2
votes
2answers
2k views

What do you suggest for cross platform apps, including web

I have always preferred cross platform development over most other concepts as long as I can remember. Which is one of the reason I never got into .Net. Currently, I use php/javascript/python as my ...
8
votes
3answers
12k views

Certifications for Javascript developers? [closed]

I'm looking for a solid and but fast paced entry in field of javascript development. The following topics come to my mind: Javascript advanced concepts, OOP jQuery, jQuery-UI, jQuery-Mobile ...
2
votes
1answer
415 views

Is there an easy way to map directory structure to a MongoDB schema?

I'm trying to store a directory structure, including files and their content, in MongoDB. The work is part of a synching app, and is using in Node/Mongoose. Now, I'm new to Mongo, and it's late here ...
3
votes
3answers
295 views

Feedback on this back-end stack

I'm planning to setup an scalable architecture capable of providing web services on a REST interface where JSON will be sent as a result. The web services will be quite simple for a CRUD web 2.0 app. ...
10
votes
3answers
1k views

How to write manageable code with functional programming?

I just started with functional programming (with JavaScript and Node.js) and from the look of things it looks as if the code I am writing would grow to be one hell of a code base to manage, when ...
7
votes
3answers
828 views

Significance and role of Node.js in Web development

I have read that Node.js is a server-side javascript enviroment. This has put few thought and tinkers in my mind. Can we develop a complete data-drivent web application utilizing just JavaScript ...
1
vote
1answer
658 views

Writing a game engine using javascript

..by this I mean a logic handler for a chess game. Basically validating a move and checking if somebody has won. Now ignore the complexity of the game(if you can..) I'd like some sort of psuedo code ...
6
votes
5answers
383 views

What does it mean for software, libraries, and languages to be asynchronous?

With popular software out today like Node.js, Celery, Twisted, and others boasting about being asynchronous, what does it mean? I've gone through the basic Node.js tutorials and written a few ...
2
votes
4answers
573 views

Recommended way to start with Javascript for client- and server-side [closed]

I'm thinking about to switch in middle term to node.js for server-side and mostly jQuery and scriptaculous for client-side web development. For the scripting I'm planning to use coffeescript. do you ...
2
votes
2answers
272 views

Do some interpreted languages only load the scripts once?

The benefit of a compiled application was that all the libraries and classes are loaded one time and sit waiting for input right? I come from a background working with PHP and the resources/classes ...
31
votes
4answers
5k views

The importance of Design Patterns with Javascript, NodeJs et al

With Javascript appearing to be the ubiquitous programming language of the web over the next few years, new frameworks popping up every five minutes and event driven programming taking a lead both ...
22
votes
2answers
12k views

What are the pros and cons of Node.js? [closed]

I'm designing a web application that is locally focused on JSON objects to do all the data stuff (and after that I would pass it to a server to cloud synchronize). However, somebody in an answer from ...