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

learn more… | top users | synonyms (1)

-4
votes
0answers
27 views

How much/deep node.js should I learn before learning into node.js frameworks [on hold]

Hello guys I just finished recently two books about node.js and played with it a bit. I am wondering how deep/much should I learn before moving into node.js frameworks like sailsjs,meteor,express? ...
0
votes
0answers
9 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
46 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 ...
-1
votes
1answer
88 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
234 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
77 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 ...
0
votes
0answers
39 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
0answers
4 views

Merge 2 images with specific top, left, width, height in GM Imagemagick Nodejs [migrated]

I have two single images, background.png and tree.png. I'd like to place the tree.png on top of my background.png at (150, 150 ) while resizing the tree.png to specific 100x300px. Here is what I've ...
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 ...
0
votes
0answers
44 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 ...
3
votes
0answers
91 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
271 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
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
143 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
88 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
75 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
149 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 ...
2
votes
2answers
67 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 ...
-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 ...
0
votes
0answers
49 views

Declarative Transactions in Node.js

Back in the day, it was common to manage database transactions in Java by writing code that did it. Something like this: Transaction tx = session.startTransaction(); ... try { tx.commit(); } catch ...
2
votes
0answers
63 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 ...
0
votes
1answer
92 views

How to unit test models in MVC / MVR app?

I'm building a node.js web app and am trying to do so for the first time in a test driven fashion. I'm using nodeunit for testing, which I find allows me to write tests quickly and painlessly. In this ...
1
vote
2answers
333 views

How to represent a tree structure in NoSQL

I'm new to NoSQL and have been playing around with a personal project on the MEAN stack (Mongo ExpressJs AngularJs NodeJs). I'm building a document editor of sorts that manages nodes of data. Each ...
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 ...
0
votes
0answers
716 views

How to parse multipart field/file data separately?

I want to parse a multipart form twice: Once to grab the incoming fields, and later to process the file upload. I am trying to maintain a proper separation of concerns within my Node app: ...
1
vote
0answers
168 views

How to authenticate user on php and Node.js

I´m currently developing a little chat page. The main page and user management is written in php and also all the authentication stuff with sessions. Now I´m planning to run the messaging stuff on a ...
4
votes
3answers
327 views

Dividing responsibilities between client and server

I'm working on a Web app that uses node.js on the server and AngularJS on the client. I'm new to Angular, but enables writing client-side applications that can be more self-contained than some other ...
1
vote
2answers
262 views

Programmatically syncing with remote servers

My application generates text files that need to be synced with remote servers, which may be windows or linux. Sync has to happen without user's intervention. I tried with rsync but windows doesn't ...
0
votes
0answers
199 views

Optional dependencies in npm?

I have a similar question to this, but not quite the same. I would like for the user of my app to install it with whatever dependencies are needed for the way he would want to use it. So, for ...
2
votes
1answer
437 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, ...
0
votes
1answer
58 views

What to test in this project?

Every developer advocates test-driven development, but I am coding a website in NodeJS and I am not testing my app. This is not because I don't see any reason. I know it allow me to check at each ...
0
votes
0answers
104 views

Is my application secure enough

first of all, I don't have any code to display in my question here, because I'm still designing the application structure, so i only got design developed. I'm building a phone application that I'm ...
0
votes
0answers
51 views

How to store progress of abstract events?

I making a game in node.js. I have players and they can perform a lot of actions. Actions are all coded as functions, and they change certain variables in either User object or other objects that ...
1
vote
2answers
594 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 ...
3
votes
1answer
549 views

Utilising Promises, Closures and Recursion in Node.js

I have employed a recursive call to a closure in order to mitigate against some race conditions I am getting (That's what I think it is). I'd like to know if (and why) this is a good solution or a bad ...
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 ...
0
votes
2answers
179 views

Making server logic independent of client interaction

I'm trying to make a realtime multiplayer web-game in node.js with express framework and socket.io library. But I can't seem to make my server-side logic independent of client interactions. I want ...
0
votes
0answers
372 views

Looking for changes in a MySQL database with node.js for a live dashboard

So, I work for a NOC in a small ISP. We're planning on getting a large wall mounted monitor and I'd like to make a dashboard in Node.JS - I've never used node before so it should be interesting. I'm ...
0
votes
1answer
202 views

Design questions for a Node.JS based Dashboard

I checked with meta and apparently this is the best place to ask! The company I work at have many environments, and as such, many Nagios/Icinga etc boxes in each environment. We currently have a ...
1
vote
3answers
377 views

Why should I use node.js as http server?

I know what node.js is & what it does. What I really want to know is how does it work as an http server? A server like apache gets a request, fork a process, allocate memory to process, handle ...
4
votes
2answers
329 views

Why might I switch from ASP MVC to Node/Express?

So I've been wanting to try Node and Express. Not to mention Jade and Stylus. Webstorm has in my opinion an amazing user experience and I want to use it and these technologies. Here is where I get ...
0
votes
0answers
271 views

How can resolve an URL on a specific DNS server

I'm currently facing a issue on a project. I'm resolving URL's on multiple DNS servers using a node.js server. Until here, everything is fine. But some ISP restrict the incoming requests from IPs ...
2
votes
0answers
211 views

scaffolding a multi-angular-app portal with usersystem

I'm trying to find the best way of developing a portal that a user can log in to and then be presented with a range of different apps (angular). They should share the same api-backend. I think that ...
2
votes
4answers
650 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 ...
4
votes
1answer
304 views

nodejs chaining with async

I'm trying to chain a series of methods that are async. I have heard of promises and futures but what I'm looking for is: obj.setup() .do_something() .do_another_thing() .end() and not: ...
0
votes
1answer
270 views

Listing dependencies in the package.json for a node.js app on Heroku

I previously had an issue with my node.js app on Heroku. I added the dependency into my package.json and now it is working. But, is this the best way to do it? { "name": "application-name", ...
-1
votes
1answer
212 views

Intranet application platform decisions wamp vs node [closed]

I have a client/server java application with a firebirdsql backend. This is a pain because I have to install java and the client on every workstation, etc So it is now time to rewrite the ...
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 ...