Node.js is an event based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications.

learn more… | top users | synonyms (2)

0
votes
0answers
7 views

Node: Routing through controller's file name

Before I started learning Node.js I was happy doing my projects with PHP codeigniter. So when I learned Node.js, I tried to implement the routing mechanism codeigniter use by looking up controllers ...
2
votes
0answers
19 views

Extracting data for a tag cloud using Lazy.js

I've just started using Lazy.js, which is my first exposure to a "functional style" javascript library. I'm still utterly lost as to which of the hundred different functional javascript libraries to ...
0
votes
1answer
32 views

Asynchronous database lookups in Node.JS using Promises

Not confident enough if this would be the correct 'node way' of writing Promises: Essentially, there are two async database calls, the result from both of these ...
-1
votes
0answers
21 views

Nodejs twitch bot, writing good javascript [on hold]

Javascript is a language where it's really easy to fall into bad habits and writing bad code that is hard to maintain and extend. I have made myself a twitch (irc) bot completly written in node and I ...
1
vote
0answers
38 views

Managing modules in phone book app

This is a test app built with nodejs, express and mongodb, below code is the main and complete JavaScript file, I would like suggestions on dividing it into different modules and making the main ...
-2
votes
0answers
18 views

CLI tool as an npm package written with NodeJS

I wanted to know if you know anything which can be made better here. I've done this with a library boilerplate from airbnb. I didn't know what can be enhanced here. If you know something please let ...
0
votes
0answers
29 views

NodeJS link shortener

I made an app in NodeJS, with Express and Mongoose, that takes a URL as input into the address bar, and returns an alias to that URL. It can be used as a link shortener. The app is intended to ...
0
votes
0answers
19 views

How to avoid callback hell in my node js code to make it faster and use the single thread modal to avoid blocking thread?

I am using MEAN stack to develop my application. My server has three clients app 1. iOS App 2. Android App and 3. Browser based App. All app is served from single server. I am facing problem when I ...
-2
votes
0answers
125 views

Express.js production deployment

I am running an Ubuntu EC2 where I am using Nginx to proxy all port 80 requests to the socket that my Node.js app is listening on. To start my app, I am using PM2. When I wrote the server for my app, ...
2
votes
0answers
40 views

Knowledge base app using MEAN stack

I've been working on an app based on the MEAN Framework. I have got the app working but I just wasnt sure whether my coding structure and standard was good enough, meaning does it adhere to the ...
1
vote
0answers
14 views

Updating Angular JS Model [closed]

I am trying to write a basic wiki/item list that pulls data from an external API (one I set up for testing), lets you add a new item which then updates the model accordingly and posts it back to the ...
0
votes
0answers
21 views

Bluebird promises: generalized retry logic with timeout

I'm attempting to write an idiomatic utility that uses bluebird promises to retry asynchronous logic until it is successful, or until a set timeout expires. Currently I'm looking at: ...
0
votes
0answers
21 views

Get top of request given the file exists in Node.js application

The user can specify which source to get the list, if the file is not found then Boom returns 404. After that, the found source will fetch the top list and append ...
1
vote
0answers
34 views

Reading content of directory for each HTTP request

I have a piece of code written in node and I wanted to know if I am in the right direction. Basically I have a site where the homepage lists 6 vehicle cards. Every time the page is requested I do the ...
0
votes
0answers
15 views

Async boolean expression evaluator in ES6

This is a pretty simple Node package designed to accept a "boolean expression" and evaluate it asynchronously. The full project is on GitHub. Essentially, an expression like ...
1
vote
1answer
20 views

Updating HTML table (Userlist) with Node.js

I currently have an HTML <Table> with all the socket.io-rooms. Client-side, the table gets fetched if you visit the page. If some room gets created or ...
0
votes
0answers
50 views

Calculator in Node.JS

I'm new to parsing, and there's only one way to learn anything, and that's to do it yourself. So I did. I wrote what is essentially a calculator. But instead you will send it a string and it will be ...
0
votes
1answer
25 views

Handle API Timeouts in Node Sails.js

I am working on a node.js sails.js app that handles a number of API calls and uses Bluebird for promises. The API calls have been reliable but I would like to build in handling for if they do not ...
1
vote
0answers
16 views

Using mongoose aggregate function and saving to user model

Any thoughts on making this better? ...
1
vote
1answer
48 views

Reading text from the web and writing to a JSON file

This code reads text from the web using a WebDriver element and writes data to a JSON file. I had to use if-...
2
votes
1answer
69 views

Probe for open application on a TCP port

I need to examine an application port to see if it opens and I need to put the retry count as a parameter. Since I'm new to Node I wanted to get your feedback on it for improvements. ...
0
votes
0answers
18 views
0
votes
0answers
66 views

Npm-module: socket-event

I've written a small npm module. It is my first module. I'm asking you to review several things: The code. I am rather starter, so any wise critic will be super. Any suggestions or ideas on the ...
3
votes
1answer
28 views

Reading transactions from a file and writing them to a database table

I am learning Node.js and I would like to see if I'm using it correctly: ...
5
votes
1answer
51 views

VCF parser for eventual genomic data visualization

I've just started out writing an app that will visualize genomic data for anybody to understand. When you get your genome sequenced the raw data usually comes in the form of a VCF file. I started out ...
1
vote
1answer
31 views

Simple POST function in ClojureScript and Node.js

Node's HTTP library provides a handy shorthand function for GET requests. Something similar doesn't exist for POST requests. I'm trying to write one in ClojureScript that compiles to node-readable ...
3
votes
1answer
39 views

Loading a database table using a promise chain

I am creating a util module that I'm using to communicate with a MS-SQL database. I want each public method to return a promise. I started with a private function that executes a DB query and returns ...
5
votes
1answer
38 views

Chat.SE in Websockets

This is a script that accesses the SE impromptu APIs to receive the fkey, a variable need for connection to chatrooms, and uses it to build a websockets connection ...
3
votes
0answers
24 views

Periodically monitor if record is not updated using Node, Event and setTimeOut

Here is my scenario: Every user checks in every five minutes. If some user doesn't check in after 5 minutes, I should be able to keep track of it. If some user doesn't check in N number of times, an ...
3
votes
1answer
49 views

Nodejs Async get request

I made a small application that makes async calls to an api (local in this case). The target application will make a million of calls per day. With maxSockets set to 1 I had a time of 45 seconds. ...
1
vote
1answer
57 views

Very basic isomorphic JavaScript application

I'm trying to update my skillset by learning how to write isomorphic JavaScript applications. For my stack, I've chosen React and Express - no database yet. The problem many people seem to face when ...
6
votes
1answer
61 views

Baking homemade pies has made me so many new connections

Sorry, if you were looking for fresh baked pies, I only have a web client to help you sell them. I've recently picked up server-side JavaScript and have added it to my toolbox, and while I've had a ...
1
vote
0answers
25 views

Properly updating multiple MongoDB documents with Angular

In the app I'm creating, when a user upvotes a post, the post should be upvoted, as well as the user that wrote the post. But this updates two MongoDB documents. This presents a number of issues. I'll ...
1
vote
0answers
34 views

Async process to send a contact email and confirmation message

Using nodemailer and node-email-templates to send a contact email and confirmation message. As is, I can catch any errors, but (if a file attachment is included), this process can take up to 30 secs ...
1
vote
2answers
56 views

Checking if an element exists in an array efficiently and return it

I am writing a function for my node/angular app that will prompt the user with a random question that he was not asked before. To achieve this I wrote this function: ...
3
votes
0answers
36 views

Checking a user registration form before sending

I think this isn't right way. Maybe you can suggest something about error-displaying in error-container which fill in JS. index.html ...
7
votes
1answer
34 views

Refactoring a phantom server called Swayzee

I have made a tool that is pretty useful for me. I have made it open source on github. It is a server that listens for requests and returns an HTML static version of a single page app. It works with a ...
5
votes
1answer
108 views

Sails.js controller method for an admin to update a user account

I am new to Sails.js, Node.js, and web application development in general. My current understanding is that well-written controllers should be "skinny" meaning they should be as simple as possible, ...
-4
votes
1answer
50 views

Create new object with properties of other two objects [closed]

I'm working with two huge objects: event and booking, and in my code I need to create a new object with just a few properties of both objects, which I am doing like this: ...
3
votes
0answers
29 views

RESTful API for serving videos to a client

I'm building an app that serves videos to a front end client. My stack is Express/Angular/SQLite. The db doesn't hold users, only root. I'm concerned that my controllers are too hardcoded, but I'm ...
3
votes
2answers
22 views

Promises turning into pyramids

I'm using node-ftp to download some files from an FTP server; due to nodeback difficulty and nested calls I'm promisified some of the calls, hoping that this will help get me out of pyramid code hell, ...
2
votes
1answer
36 views

Removing spam from a database using NodeJS

I've written the following in NodeJS as I am trying to learn a bit more about that toolset. It 'works' but is not very robust. I am not concerned with security at this stage and the code will not be ...
1
vote
0answers
234 views

Node.js module architecture for third party API

(If my questions below code seems too broad for coderewiew, please feel free to downvote this topic) I'm writing a node.js module that is basically a wrapper for some API functions of third party ...
3
votes
1answer
55 views

Unit Testing Express Middleware That Verifies Auth Tokens

I am writing an Express middleware component that'll run on Node 4, which has limited ES2015 support. The fundamental purpose of this component is to verify JSON web tokens, using the jsonwebtoken ...
1
vote
1answer
42 views

Continuous integration tool

I am writing a trivial continuous integration tool using node.js to learn the platform. So far it can download a project from Github, and unzip it into a random folder in a predefined dropfolder. But ...
7
votes
1answer
138 views

A simple weather app in Node.js

while practicing Promises, I ended up with a simple weather application which works on the command line. I would highly appreciate it if you can point out any flaws ...
3
votes
1answer
103 views

Simple Password-Manager in Node.js

I have programmed a simple command line password-manager in Node.js during my learning process, and since I am done with it, I would highly appreciate a review. Comments could be based on any topic. ...
2
votes
1answer
52 views

Running multiple games concurrently with node.js

I am currently creating multiple games by adding objects of type Game as properties of an object called games. The names of ...
5
votes
1answer
30 views

Node bot to send out reminder-emails if a team member doesn't submit their weekly schedule

This CalendarService is part of a little node-bot I wrote today which sends out reminder-emails if a team member forgets to submit his weekly schedule in time. Calendar backend is using Google ...
3
votes
1answer
54 views

API to verify whether a Redis entry exists

I come from a PHP object oriented framework background (Laravel, Symfony, Silex...). With that, validation comes in pre-built classes mechanism in a framework that validates for you parameters that ...