Tagged Questions

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

1
vote
0answers
21 views

Node.js Is this a great way to show pages in a minimal way as possible?

I'm trying to make a Node.js server as minimal as possible to show a landing page, but i'm not sure this is the greatest and fastest way to do it. I'm using dirty to store my html data. My app.js ...
4
votes
1answer
47 views

How to Optimize Merge of Two Objects That Include Arrays of Objects

I need to merge two objects in a code path that is going to be heavily used. The code works, but I am concerned it is not optimized enough for speed and I am looking for any suggestions to ...
3
votes
1answer
49 views

How to refactor common methods that depend on local variables into a base class

I'm using Node.js and am creating some models for my different objects. This is a simplified version of what they look like at the moment. var Foo = module.exports = function () { var values = ...
4
votes
1answer
92 views

Node.js callback error pattern

controllers/users.js var usersModel = require('../models/users.js'); users.create = function(req, res){ usersModel.create(req.data.username, req.data.password, function(error, user){ ...
2
votes
0answers
59 views

My first implementation of mongoDB

I'm new to Code Review, my assumption is that it is a place I can get feedback on working code that I've built, I hope that is right. This is my first implementation of mongoDB, much much more to ...
0
votes
0answers
63 views

Is this a good way to fetch tweets using nodejs?

I've written a nodejs script that fetches tweets from my twitter account (using the REST api at this moment), does a couple of things and stuff the tweets into a SQL database. The script intervals ...
1
vote
1answer
83 views

Node.js Nested Callbacks, multiple requests

I'm making requests to Parse.com to 3 different objects that are needed to render a View. I'd like to know what's the general/best approach in cases like these in which there are multiple requests ...
1
vote
0answers
90 views

Node.js asynchronous code design

I am writing a lightweight JSON api, and I come from a PHP background, so I have some questions/reviews about async node.js code. This is my code so far: main.js var http = require('http'); var api ...
1
vote
1answer
192 views

Node.js building a JSON restful web api structure

I am building a JSON restful web api in Node.js and so far I only got the main structure, however I am not 100% sure I am doing this correct from scratch, I still have to get used to the fact that ...
1
vote
2answers
75 views

Build process for compiling client JS modules into one script

I am currently writing a rather large client-side JS application which is made of of multiple modules, each in different files (before compiling). I am using Node.js to build the final script based on ...
0
votes
1answer
33 views

Is there a better way to update fields in an web app?

This is the stripped down version of my update action for a Posts (blog post) controller: Posts.update = function(req, res){ _.extend(req.post, { title: req.body.title , author: ...
2
votes
2answers
149 views

Will this code block in node.js

When reigstering a user I request two reads from the database to see if there is a username and email and then I write if the checks pass.. Can anyone tell me if this code will block other users? I ...
1
vote
2answers
74 views

A server response written in node/express/mongodb: does this look right?

This is my very very very first attempt to write anything meaningful in node. The client side is a simple form that has login, workspace, and simply saves them onto the database. It would have been a ...
0
votes
0answers
45 views

Best way to get MD5 of stream and then pass stream to a reader in Node.js [closed]

I'm parsing an email and whenever I hit an attachment, I want to upload the attachment to S3. Whenever an attachment is found I get a stream for the attachment. I want to get the MD5sum of the ...
5
votes
1answer
379 views

Node.js password salting/hashing

In view of the recent LinkedIn breach, would anyone care to review my data access routines relating to user access? This is a standard node.js module, accessing a Postgres database. (function () { ...

1 2
15 30 50 per page