1
vote
2answers
29 views

Why Object.create does not work in node.js

In developer console (Mozilla, Chrome, nvm) this code work as expected: var proto = {x: 3}; var obj = Object.create(proto); So obj will be {x: 3} But in node.js i get {} Why?
0
votes
0answers
13 views

node.js Child Process has timeout?

In short: does the child_process automatically dies after certain time not being accessed for certain period( or is there anyway we can set this), or do we always have to explicitly kill the processes ...
0
votes
0answers
6 views

Node JS JSftp Get binary data, return string

I am relatively new on Node JS. I am working on an application fetching XML-files from a server. In summary I want to do this: Download XML-files from FTP server and store the XML-content as a ...
0
votes
1answer
20 views

Node JS Find all element's attr

I would like to find each element's id but I "each" doesnt work (there is no metode each...) How can I return each element's ID? var libxmljs = require("libxmljs"); var xml = ...
0
votes
2answers
25 views

using `new` and `()` with require

What is the difference between var events = require('events'), emitter = new events.EventEmitter(); and var emitter = require('events').EventEmitter; or EventEmitter is pretty forgiving in ...
0
votes
0answers
15 views

How to choose between Node.js and JXcore?

JScore seems to be Node.js improved. Check this carefully designed quote: JXcore comes with a built-in multithreading support that can be enabled on your existing Node.js applications without ...
0
votes
0answers
15 views

one object doesn't listen to an event emitted on another object

Trying to make an object emitting and receiving events: var events = require('events'), util = require('util'); function Obj(){ events.EventEmitter.call( this ); // what does this line? } ...
1
vote
2answers
18 views

Efficient way to convert UTC dates within JSON array returned by MongoDB in Nodejs to Local Time

I am using Node.js to query MongoDB and have a field that is a Date (ISODate). In Node.js after querying the Date format that is returned looks like this DT : 2014-10-02T02:36:23.354Z What I am ...
0
votes
1answer
9 views

MongoDB findAndModify not working with monk

I am trying to use findAndModify with the node.js mongodb module monk.This is the method that I am using,this throws a 500 error in my cmd: ...
0
votes
0answers
13 views

Mongoose: aggregate query for showing only most recent document version

I'm trying to create an aggregate query (or any query for that matter) that will only pull the most recent document version. I tried using the suggested aggregate query with $$ROOT but that throws an ...
0
votes
1answer
12 views

Issue with inheritance in node.js: assignment error when attempting to overwrite prototype for subclass

thank you for taking the time to help me out. I'm attempting to learn node.js and have run in to the following problem when working on understanding inheritance: var stream = require('stream'); var ...
0
votes
0answers
10 views

node.js and mocha-qunit-ui: test with asynchronous requirejs dependencies

Short description first: The test in the following snipped is never executed: setTimeout(function() { test("test", function() { ok(true, "okay"); }) }, 1000); Is there any way not ...
0
votes
0answers
27 views

The requested method POST is not allowed for the URL

I am making an app that when button clicked, Sending a GCM message. so In my server , I inserted my server code of nodejs. and below is my server code(GCM_nodeDemo.js). and when i post MY SERVER ...
0
votes
1answer
30 views

React.js: handleSubmit or onClick not triggered when rendered on the server side

Here is the source code: index.js: module.exports = require('./app/server'); app/server/index.js: 'use strict'; var env = process.env.NODE_ENV || 'development'; var express = require('express'); ...
0
votes
1answer
19 views

Gulp/Grunt: Concatenate only necessary JS files?

Wot I got I have a gulpfile that produces app.min.js and libs.min.js; fairly selfexplanatory: var dev = { libs: [ 'bower_components/angular/angular.min.js', ...
0
votes
1answer
16 views

Where does the Node.js form data end up?

I created this small example to find out where the form data end up, but I can't figure out where. I would expect to find some data in req.body, but as you see if you run the example, if comes out ...
0
votes
0answers
14 views

Proper way to manage paging and search/filter on a REST API made with Node and Express

I am playing around with Node and Express. My current problem is not "how to do things", as I have my paging and filtering/searching working in my "mini API" that I have made from scratch and that I ...
0
votes
1answer
19 views

deleting MongoDB entry when URL is visited - node.js

I'm working on making a simple Twitter clone for a project using node.js and express, and storing the tweets using MongoDB. I am trying to implement deleting functionality for the tweets. a user's ...
2
votes
2answers
48 views

Deep “npm update”?

Running npm update updates items listed in package.json; however, the dependencies of those items are still outdated. The obvious workaround is to run npm update once more. Sometimes I need to run ...
0
votes
1answer
25 views

Juggling Async - LearnYouNode - Closures

I have been learning nodejs with the help of learnyounode and I am stuck on Juggling Async. My solution works with the exception of the hardest part of the problem - it prints the results out of order ...
0
votes
1answer
15 views

Mongoose finds empty array when it shouldn't

I am trying to find a SoldProduct with intimeOrderNumber equal to '3'. var query = { intimeOrderNumber: '3' }; But I get an empty array. SoldProduct.find(query, function(err, soldProducts) { if ...
0
votes
2answers
40 views

Waiting for async callback before returning a value

With fileA userID = (userName) -> id = 0 someAPI.getUser userName, (err, data, res) -> id = data.id if data console.log id # Outputs ID return id console.log ...
0
votes
0answers
7 views

grunt-wiredep doesn't injecting js libs with dot in lib folder name

grunt-wiredep while executing grunt wiredep:target task returns: leaflet.markercluster was not injected in your file. Please go take a look in ...
0
votes
0answers
22 views

error in connection the socket.io from different server

I am making a mobile app with node.js REST API as backend and Angular as frontend both will be on different server. the angular app will later be on attached with phonegap to make it hybrid App. I ...
-2
votes
0answers
36 views

Website design with serverside scripting [on hold]

I apologise if im not precise enough but I have very little knowledge in these areas. Im working on a website and Ive read so much about possible approaches and solutions that my brain is melting. At ...
0
votes
3answers
26 views

How to obtain document that was just upserted in mongodb?

In the following command, where foos is a collection, I "upsert" a new item: foos.update(criteria, { $set: fooUpdate }, { w: 1, upsert: true }, function(err, upsertedFoo) { /* ...
0
votes
2answers
16 views

Position of function affecting output

I am converting data in POST request to upper case using streams in nodejs. I have two code snippets, one is working fine, but another snippet is behaving differently First, which is working correct ...
0
votes
0answers
14 views

How do I download a web server's SSL certificate using Node.js?

I'd like to download the SSL certificate of a web server, using Node.js. I have seen how to do this using OpenSSL, and this works, but it's not Node.js ;-) Node.js's function getPeerCertificate ...
0
votes
1answer
14 views

Load JSON file for Grunt from node command line

I have a number of different JSON files which I use for variables for Grunt to load. Eg. project1.json project2.json project3.json Each JSON is for a specific project which I load within a ...
0
votes
0answers
12 views

Why does oauth signature and token fail when validating?

var URL = 'https://api.twitter.com/oauth/request_token'; var parameters = { oauth_consumer_key : 'key', oauth_nonce : 'kllo9940pd9333jh', oauth_timestamp : '1191242096', ...
0
votes
0answers
13 views

NeDB clears database on load

I have a NodeJS server with NeDB and I have my server load a database file called 'users.db' everytime it launches, it works but it clears the database everytime! Also when I insert data into my ...
-2
votes
0answers
16 views

Is there a good alternatives to actionhero.js? [on hold]

Is there a good actionhero.js alternatives for building API's with multiple protocols support? (including in other programming languages)
2
votes
1answer
48 views

JavaScript, objects and concurency

I have a relatively simple project with very little code that is giving me headaches as I don't know what is causing the problem. The idea is similar to http://tweetping.net/, but it is not showing ...
0
votes
0answers
11 views

How can I invoke ClientJade through Gulp?

I have been asked to help set up Gulp in a project using ClientJade to support Jade template usage on the client. Currently there are three folders of templates, and ClientJade is run on each to ...
0
votes
1answer
17 views

How to handle socket.io events in single page application?

I am working on single page application, This application is realtime visualization for analytics. Technologies/programming language used: AngularJs Node.js socket.io I am having the following ...
1
vote
0answers
25 views

Not getting the data form json file in chrome net::ERR_FILE_NOT_FOUND

Not getting the data in chrome in firefox works fine. Need to work offline and online also. That should fetch data form json but not woking in chrome. $.ajax({ async: false, type: "GET", ...
0
votes
1answer
19 views

Rendering engines for a backend in MEANJS stack

We are creating a website that allows users to write email templates and select items that will be automatically filled in. The program is a MEANJS stack and in the nodejs back-end we have a ...
-1
votes
0answers
7 views

Node.js connectivity to oracle databse remotely on windows

I want to connect the oracle database which is located at remotely using node.js on windows. I am very new to node.js. My machine configurations are: windows 7 32 bit python 2.7 visual studio 2010 ...
0
votes
2answers
23 views

How to read file in Node?

I want to read file but if file not available on particular path than gives an error.I want to create a file if not exist and get data value is null. I used these code but not working please any one ...
-1
votes
1answer
34 views

what is the best node js framework to build a highly scalable webapp [on hold]

I'd like to build a webapp that is highly scalable to cater many users using nodejs. For this I have considered some frameworks (Ideally with MVC support) like meteor, sailjs, meanjs. But my ...
0
votes
0answers
7 views

Catching “socket hang up” error in request module

I'm using the request module to send requests (GET & POST) to a 3rd-party API. I'm using the timeout option to limit the waiting time for the response (can't wait too long for it). The problem ...
0
votes
0answers
21 views

How to perform a variable number of mysql queries in Node.js

I m trying to perform multiple mysql queries in my node.js app. The number of queries is variable, so I cannot nest the queries in callbacks. The caolan/async module looks promising, but I cant get ...
0
votes
1answer
16 views

node.js how to use a minified library used in client side

Basically, I am encoding a wav file using libopus.js on the client side, now on the server side(node.js) I have to decode it using the same library, this is where I am getting lost, not sure how adapt ...
0
votes
2answers
27 views

Is it not necessary for a callback method to have a definition in node.js?

I am new to node.js. I have been seeing code where a callback method is just called but it is never defined anywhere in the file. So without definition what does that call to the callback method do ...
0
votes
0answers
51 views

Node.js net socket memory leak?

I have this script. var net = require("net") , heapdump = require("heapdump"); function onConnection (client) { client.on("data", function (data) { client.end(); }); }; function onListen ...
1
vote
2answers
13 views

res.render() Locals Location on Frontend

This is probably a stupid question, but in Express, when you define local variables in res.render(view, {variable: variable}), how are they accessed on the frontend? Where are they kept? When I try to ...
0
votes
1answer
29 views

Retrieving type after reading from json file

Lets say I write the following to a JSON file data = { number : 10, string : "Hey stackoverflow!" } After I JSON.stringify (data) it writes it to a file as { "number" : "10", ...
0
votes
0answers
14 views

Ember.js Authorizaton header and oauth_signature

How I can generate the oauth_signature and oauth_nonce in ember.js? How I can pass Authorization Header in Ember.js? App.TwitterController = Ember.ObjectController.extend({ actions: { ...
1
vote
1answer
21 views

Setting template variables from routes/index in express 4

I'm new to node.js and express. I've installed express 4 using the "express myAppName" command from the terminal, which creates a default directory, and I'm using Jade templates by default. The ...
0
votes
2answers
32 views

For..In Loop Overwriting ALL Array Values

I'm trying to use a for..in loop to iterate through a list of names, add them to a template object ('group'), then add each complete object to an array ('queryList'). This isn't working because each ...