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

learn more… | top users | synonyms (1)

1
vote
1answer
65 views

Respectable design pattern for making node modules flexible/testable?

I am looking to get some input from some more experienced testers than what I am. :) I am trying to make my node modules testable, allowing for dependency spying/stubbing/mocking without the need to ...
1
vote
0answers
28 views

Can Bower be replaced by NPM?

Bower has this ability to resolve shared dependencies versions with a common version. This was not possible with npm v2 but this feature will be available with npm v3 as described in the npm v3 docs. ...
1
vote
1answer
37 views

Is there any value in using a Promises library versus ES6 Promises?

I see a lot of NodeJS articles recommending the Bluebird library for promisifying your code and avoiding callback spaghetti. Is there any value in using such a library when using Node 4.2.4+ given ...
1
vote
0answers
21 views

Feedback on simple authorisation system design

I'm writing a fairly simple authentication/authorisation api for an intranet application we are developing. It's my first roles based authorisation system and its a good opportunity for a first ...
0
votes
0answers
31 views

Best practices for adding Node.JS build features to a non-Node project

The primary use for Node.JS is of course as a full server stack, and I've used it in that manner to great success. However, a number of useful, interesting NPM packages deal with things like ...
0
votes
2answers
102 views

node.js C++ addons to do all major computations [closed]

A major limitation of node.js is its single threaded execution and the fact that JS is slow with computations. What are the advantages/drawbacks of using C++ to do the application's heavy lifting ...
2
votes
1answer
177 views

How to structure big Node.JS modules

I am working on a rather big Node.JS project with several thousand lines of code. It's not a homepage, but acts more like a configurable general purpose application server. As such it brings some ...
1
vote
1answer
27 views

How to handle file uploads express (UUID / location)

I am building a community website with a NodeJS express backend and a mysql database. Now I am up to the point where I want to store profile pictures of users and pictures related to specfic ...
0
votes
1answer
168 views

Confusion over Node as a “script” vs Node as a “server”

As I was beginning to tool around a bit with node, I was told that I needed to undergo a little bit of a paradigm shift since I was coming from a PHP background. I would ask questions like, "I have my ...
0
votes
1answer
98 views

When to use “is a” or “has a”? [closed]

In my node.js application, I have a queue class which has push and pop methods and a data property. I have an Event class which handles an event and pushes it on to the queue. If I think object ...
1
vote
1answer
59 views

Amazon Echo Development on LAN

I have followed the tutorial from Amazon to get started with the Echo. I made a skill and setup an application server on their AWS Lambda for basic testing. I have a few questions about the Echo, ...
0
votes
1answer
85 views

Handling multiple asynchronous events - Wait for pending offers to process on new offer?

I have a programming problem, that I don't know how to solve. And while I have provided a sample of my code, I am interested in a conceptual answer on how to resolve this problem. On a tradeOffers ...
3
votes
1answer
124 views

Filtering request and responses in RESTful MEAN stack

I have a very basic RESTful service written using the MEAN stack (MongoDb, Express.js, Angular.js, Node.js) and utilizing the Mongoose ODM. Product schema var productSchema = new mongoose.Schema({ ...
0
votes
0answers
55 views

AngularJS and NodeJS required version

I am new to the world of Javascript and their frameworks, and I feel a bit lost with this. I am trying to follow the official toutorial of AngularJS. In one of the first sections, it reads Install ...
2
votes
1answer
69 views

Why does Node not support several event loops in one Process?

As the title says, why does Node not support several event loops in one Process? The idea, is that node spawns a user decided number of threads, which each have an event loop. When a new callback is ...
2
votes
2answers
105 views

Methods of separating front and back-end with full stack javascript?

Suppose I have a front-end which is mostly a single-page application written using angular, grunt, and bower. And suppose I have a backend, which is mostly just a REST API sitting on top of an ORM, ...
2
votes
1answer
37 views

Social auth from mobile app connected to API server

I have a Node.js server using PassportJS that uses social login via Google, Facebook, and Twitter. The Node.js server hosts an API that uses the PassportJS middleware to authenticate routes and ...
6
votes
2answers
137 views

Advice for designing API request rate limiter?

I'm in the planning stages of a web application that makes heavy use of data retrieved from a third party's REST API. This data is cached on the server and requested by clients via AJAX. The REST API ...
-2
votes
1answer
67 views

About Node serving dynamic pages

I am doing a tech test for a job (Web Development) and in the test I need to get data from an API and there is this conditions for the server: Focus on client-side (AngularJS) nodeJS The server must ...
3
votes
1answer
137 views

Best practice for Restful API that perform heavy calculations (Image Processing)

We are currently developing an image processing restful api. Server performs some CPU-heavy computations image processing upon request and return the image to the client. We want to make this a ...
2
votes
0answers
72 views

Upload, convert, and store multiple different product data feeds into a database

I'm not sure if this right location for this question, but here it is. I currently have about 30 different CSV or TXT product data feeds. I am trying to build a tool to 1) upload each feed 2) ...
0
votes
1answer
66 views

expressjs: is it bad practice to use req.hostname for querying a db?

I'm building a nodejs app I would like to make available under various settings by my customers. I want my customers to build their websites on top of my app, so: - the app can be configured in a way ...
0
votes
0answers
28 views

how to create messaging storage structure in redis?

I am developing Node.js, Redis based chat application in php. I had an idea about chat logger structure but I required suggestions that how and what to choose proper data structure to create Redis ...
0
votes
0answers
10 views

Proxied server requests + forwarding authentication info in a secure fashion

We are using PassportJS with a couple of Node.js servers - but we have some questions about how to use Passport with "proxy" requests. My main question is how do we (and should we at all) forward the ...
2
votes
2answers
96 views

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 ...
2
votes
3answers
328 views

Are colons ok in a REST API?

I see many REST API examples with URIs like http://<whatever>/widgets or http://<whatever>/widget/123, for a specific thing. For most things I would just stick with the front slash, but ...
0
votes
0answers
36 views

Persisting and manipulating JS ArrayBuffer data on the server

My node.js app has to deal with (sometimes large; a few MB) tables of numerical data. I'm about to use JavaScript's native binary objects for this purpose (i.e. ArrayBuffer and friends), because ...
-1
votes
1answer
106 views

Synchronous architecture with asynchronous repository

In order to keep clean architecture of my node.js microservice I have controllers, services and e.g. repositories. I want a synchronous data flow: controller -> service -> repository -> service -> ...
1
vote
0answers
42 views

Is it OK to use mongodb's query object format as a parameter for my api?

I am designing an api that can give developers read-only access to a large dataset. The data is stored in a mongodb database. All the results of the api, will basically either be a count of matches ...
0
votes
1answer
82 views

killing / SIGTERM for Node.js child_process

With regard to a child process in Node.js that is created like so: var cp = require('child_process'); var n = cp.fork('child.js'); When forking a child_process with Node.js is it proper to kill the ...
6
votes
5answers
376 views

How do I balance 100 clients checking the same database table in a loop?

What I have This is a prototype. I have a pool of 100 clients connected to the server via websockets reporting things and awaiting for commands. The server polls the commands database table of type ...
13
votes
2answers
1k views

Is Node.js a framework? [closed]

I keep seeing recruiters, developers, etc. refer to Node.js as a framework. In my opinion, this is out of ignorance for what Node.js really is. Oftentimes, in job descriptions, Node.js is grouped in ...
1
vote
0answers
35 views

Create an open source server with selected client access? [closed]

I am considering starting a new open-source project. It's a financial application with a server and client component; both the server and client side would be open source. However, when I deploy a ...
1
vote
0answers
40 views

How to implement partial normalization while keeping data integrity across documents

I've been researching how to properly design a mongo schema and came across this blog post on their site: http://blog.mongodb.org/post/87892923503/6-rules-of-thumb-for-mongodb-schema-design-part-2 ...
0
votes
1answer
92 views

NodeJS like interrupt handlers?

I got started with programming back in the DOS days. One of my early projects involved overriding the keyboard interrupt service routine with my own. Now I'm trying out NodeJS to update myself, and I ...
1
vote
0answers
121 views

Switching from Node.js class techniques to C++

I'm going to be rewriting a project from Node.js into C++11. The device the Node.js scripts are being run on are ARM based, and Node.js is slow to start up on the device. In the Node.js program, I ...
0
votes
1answer
68 views

MEAN stack — express?

I've been a rails developer for a bit now, and I've started to get into the MEAN stack through a tutorial. I kinda understand Angular and Node and the purposes they both serve, but I'm not sure I ...
1
vote
0answers
175 views

Design pattern for socket.io and Express

I have a Node.js Express RESTful HTTP server I will call server A and an Express socket.io server I will call server B. Server A responds to all HTTP requests by clients and server B listens to the ...
3
votes
1answer
77 views

Is web sockets the best solution for my problem?

I have created a Slackbot that integrates with Submittable.com. For example, I can trigger a response that displays all current submissions in Slack. I now need my Slackbot to post in Slack whenever ...
2
votes
0answers
121 views

Authenticate Joomla user from an external app based on Node.js, Javascript and MongoDB

I have an iOS App which currently pulls in all the data from the MongoDB using a Node.js server. Currently my API / my node server handles all the data manipulation the iOS app/Swift only displays the ...
1
vote
2answers
129 views

Sign up user using Microsoft Exchange Account in Node.js MongoDB

I have a question about whether a programming technique is at all possible. Most of the apps these days come with sign up with Facebook, Twitter or gmail functionality. My company has its domain ...
4
votes
1answer
152 views

Node.js callbacks and this - how it should be solved?

Every JavaScript programmer is familiar with this "problem" (it can be considered as a feature, depending on various conditions) - this is lately binded: let foo = { bar(){return this;} }; let ...
0
votes
0answers
25 views

How can I automate updating code on an integrated device with files and a MySQL database?

I have an integrated device that has a program in it currently written in Node.js. So, naturally, there are a whole bunch of files that it needs to run. Also, there is a MySQL database that it uses ...
4
votes
2answers
291 views

How to avoid circular patterns in Node?

I'm new to Node and JavaScript (well, asynchronous programming in general) and I noticed when I was working on a project that the following code is a circular pattern and that these are bad practice ...
0
votes
0answers
159 views

Emulating `tail` to stream log data via asp.net mvc

In similar fashion to this bit of node.js, I'm interested in streaming the ongoing output of a text log file via ASP.NET MVC. I'm having trouble even thinking how I would implement this using the ...
1
vote
1answer
69 views

composer is self-described as inspired by npm, so why does it handle sub-dependencies differently? [closed]

As I'm sure anyone reading this knows, the default behavior for npm is to install sub-dependencies within their respective sub-dependency directories themselves (in a new node_modules directory). The ...
2
votes
1answer
119 views

Mapping different XML and CSV feeds

Not sure if this is the right venue to be asking this but here goes. A little background. I'm trying to build an ecommerce app that would allow sellers from other venues--like, amazon and newegg--to ...
2
votes
2answers
199 views

Reading using non-blocking IO on a fd asynchronously in C++ (moving from Node.js)

I'm trying to switch my brain from Node.js/Objective-C iOS programming to C++ programming, and it's a little bit taxing. Node.js and Objective-C with iOS do not have a run loop that I am supposed to ...
1
vote
1answer
69 views

Best place to declare functions in this example

Suppose I have code that accepts html GET requests: server.get('path/to/some/endpoint', function(req,res) { function a() { //function goes here } } Is it better to declare functions ...
1
vote
1answer
269 views

Polyglot Node.js with Typesafe Akka for Actor Model

I have a case that needs to manipulate a large stream of JSON and inject it into Apache HBase. Our system works on Node.js with Mongo then, since we need to enhance performance, so HBase is choosen to ...