0
votes
1answer
13 views

Node.js and mysql Callback : query in query callback

All I want to do is insert some data if my database doesn't have that, so I put Insert SQL into my callback function of my Select SQL, but I got error like this: { [Error: Cannot enqueue Query ...
0
votes
1answer
25 views

Node.js: Serious Memory Leak Bug in newer versions?

What's the problem? First I tought something is wrong with my node.js modules or codes because as I visited my pages the memory decreased after every visit and it was not released back. After hours ...
0
votes
1answer
25 views

Angular.js - Redirection not working

I have somes difficulties to understand the behavior of Angular.js routing Here is my code my app.js: 'use strict'; var app = angular.module('myApp', []). config(['$routeProvider', ...
0
votes
1answer
15 views

During insert : E11000 duplicate key error index

I am using mongojs and Node.js to insert a document in mongodb. It is a REST API and there is only one instance of mongojs (with native drive). Everytime, there is an api call, SAME mongojs object is ...
-1
votes
1answer
48 views

JavaScript - Array undefined? [closed]

I believe my issue would be best described using a snippet of code. var room1 = []; var room2 = []; var room3 = []; var room = "1234"; socket.on("connect", function() { ... var ready = ...
0
votes
0answers
12 views

How to use node-webkit-agent?

How to use node-webkit-agent? I'm stuck with the second step: Using your browser, go to devtools frontend URL corresponding to your nodejs version How can I access the devtools?
0
votes
1answer
14 views

Trying to use EJS with Node.js

I'm trying to setup my first app using EJS (Normally use Jade) and I've got it all setup and my pages are loading, I followed a tutorial on how to do it, this is my layout <!DOCTYPE html> ...
1
vote
0answers
26 views

Where in my stack can streams solve problems, replace parts and/or make it better?

If I take a look at the stream library landscape i see a lot of nice stuff (like mapping/reducing streams) but I'm not sure how to use them effectively. Say I already have an express app that serves ...
0
votes
2answers
15 views

When Mocha Test fails it logs an object to console

When all my tests pass, everything works as expected. However, when a test fails with any reporter active, the runner prints an object representing the strack trace rather than the pretty formatted ...
0
votes
1answer
30 views

How to access function parameter from inner function?

How can I access to response parameter inside function .exec(function(err, repl) { ? Is it possible without creating local variable? #!/usr/local/bin/node // Load the http module to create an http ...
0
votes
1answer
17 views

Fixed - Node.js 303 Permanent Redirect when connecting to AWS-SDK

Good afternoon, I'm trying to set up a connection to my aws product api, however I keep getting a 301 Permanent Redirect Error as follows: { [PermanentRedirect: The bucket you are attempting to ...
0
votes
0answers
19 views

Mongoose recursive query parent reference

I am trying to do exactly what this mongo example is doing but in mongoose. It seems more complex to me in mongoose. Possibly i'm trying to fit a square peg in a round hole? This example is from ...
0
votes
1answer
20 views

Handlebars precompilation via nodejs fails on Cloud9

I am using handlebars template precompiler for express (https://github.com/diffsky/hbsc) to precompile my templates in nodejs. It works great when i do it localy but when i try it in cloud9 ide ...
0
votes
4answers
63 views

Parse PHP Arrays in JavaScript

I've some PHP source code that are simple key-value arrays like these: return array('var1' => 'var2' ); And return array('sub' => array( 'var1' => 'var2' ) ); And I need to parse them ...
0
votes
0answers
11 views

how ping to pixel-ping/nodejs server must be directly saved inside our SQL db

It must be included inside cross browser extension code. (only JS/Jquery code accepted) Method will be used to check how many unique users are using our extensions every day. All user info ( brrowser, ...
1
vote
0answers
15 views

How to make the node version of lessc or recess compile with development output for FireLESS

The following is code that can be used for the browser/live version of less. But how can I do this for the command line version? <script type="text/javascript"> less.env = "development"; ...
7
votes
3answers
86 views

Parse ill formed JSON string

I am being sent an ill formed JSON string from a third party. I tried using JSON.parse(str) to parse it into a JS object but it of course failed. The reason being is that the keys are not strings: ...
2
votes
0answers
34 views

Uncaught exception with qunit and jquery

I'm facing an issue while trying to get javascript unit tests to work at the command line using qunit. Here's some sample code to reproduce the error: file util.js: function abc() { return ...
0
votes
0answers
9 views

Why sometimes not loaded Appjs new windows?

I use this code in javascript to make it automatically open the windows in APPJS: window.open('off/share.html?titulo=Vehicle 19&id=1','Compartir Contenido','width=525,height=470') But sometimes ...
1
vote
0answers
44 views

Why mongodb find() never got to my callback

I'm trying build rest-like API using mongodb(with mogoose) and node.js with restify. I'm an absolutely novice in mongo's world. I didn't sure where problem is. is this db connection's problem, or ...
1
vote
3answers
55 views

How to return a value from a callback

I'm using node.js to perform a DNS lookup to return and IP address (http://nodejs.org/api/dns.html). In this example, I can get my result to log correctly, though I'd rather be able to have access to ...
0
votes
1answer
19 views

Trouble running socket.io in ports other than 80

I'm running express.js on port 80, so socket.io has to go on other port. The problem is that, then, I have to load socket.io on the client with: <script ...
1
vote
0answers
30 views

send email with the inputted user name using node js

In my application, i have a html form to add user. Once user is added they will get mail using sendmail() function in javascript. Everything works fine and mail is sending as my standard. But i want ...
1
vote
3answers
25 views

Issue while getting array value in NodeJS

I am using NodeJS to count the number of employees in different section. I am using Mongoose as ODM and MongoDB as database.That is my code (very simple for testing purposes). exports.list= ...
0
votes
0answers
14 views

NodeJS-SQlite multiple database reads

I'm rather new to both NodeJS and Sqlite, and I am struggling to write a function that will read a database three times sequentially and compose a JSON object from it, which I will then pass on to my ...
4
votes
2answers
45 views

Pass variables to JavaScript in ExpressJS

I am completely lost on this; I am using NodeJS to fetch a JSON and I need to pass the variable to my page and have JavaScript use the data. app.get('/test', function(req, res) { ...
0
votes
1answer
44 views

How to lock the node.js function?

I am using embedded array in mongoDB, Document looks same as below { "_id" : ObjectId("516f89b393307a0f73533863"), "desc" : "LrOBVgWHHRyAxgYdKIwwgATcGTNBlz", "comments" :[ ...
0
votes
1answer
16 views

Node.js Secure Random Float from Crypto Buffer

Not for any practical purpose, of course, but I tried to generate a secure random floating point number using the Node's crypto module. Essentially, the following: var crypto = require('crypto'); ...
0
votes
1answer
23 views

RTCIceCandidate instance cannot be created in browsers on moblie devices

I'm recently trying some awesome features of HTML5 and WebRTC, and am building a site to allow multiple people video chat. Everything works just fine on my PC and the Media Capture of HTML5 works ...
0
votes
1answer
28 views

using git on windows and push changes to linux debian 6

My notebook has Windows 7 64bit and I can make changes and commit perfectly. I have a repo on my cloud server and I push changes from my notebook to the cloud repo. Then I created a bare repo to ...
1
vote
1answer
68 views

Waiting for functions to complete in JavaScript

How come the following code, generates a different output everytime (not because of the random function) but it gives undefined for some values, sometimes some others. What is the problem? function ...
0
votes
1answer
26 views

Has no method 'setMaxListeners' error

According to this question here I need to call request.setMaxListeners(0) to solve the problem described. When I try to do: var request = require('request'); request.setMaxListeners(0); I get ...
0
votes
1answer
15 views

How can I stop node.js 422 (unprocessable entity) redirects showing an intermediary page

When I do this: app.post('/account', function(req, res){ // attempt to validate input and insert user into db signUpUser(req.body, function(success){ if(success){ // ...
0
votes
0answers
29 views

Extend lodash/underscore on node.js?

Lodash and Underscore have a method called mixin that allow you to extend the libraries. How do you write a library that will extend them? For example, if you created a file called ...
0
votes
0answers
11 views

pg doesn't seem to close the connection correctly

I am writing an application using Node.js and postgresql. When a user authenticates it hits the DB to check the user's password then supposedly closes the connection to the DB. However, if the user ...
1
vote
1answer
22 views

Template a javascript file using underscore.js

I am using node.js at the server with express.js for some rest calls, my client side is uses backbone.js for the models and views. I am using underscore.js for templating some small html code for the ...
0
votes
0answers
49 views

Is there any recommended js auto completion for emacs [closed]

I have installed js2.mode and auto complete on emacs24. now i just want a powerful plugin which could auto complete resource in js mode. can anyone give me a suggestion ?
0
votes
1answer
30 views

Stream query results with the native mongoDB driver for node

I have 100,000 records in a mongoDB collection and trying to retrieve them in a node.js application using the native driver. I follow the example in MongoDB doc for CursorStream but get the error: ...
-8
votes
0answers
41 views

I need to create my own monitoring website tool similiar to Google Analytics. How can i do this? [closed]

I need to create my own monitoring website tool similiar to Google Analytics. For now I have created one javascript file which will get the current location and current position. I have added node ...
0
votes
1answer
40 views

LESS — data-uri painter mixin

I’m trying to implement mixin customizing underline of text, like polyfill for CSS3 text-decoration properties: line, style, color, which are not supported yet by browsers. My idea is to perform ...
0
votes
1answer
75 views

About this and self in javascript

I know the "self" magic. But look at this snippet from nodejs(not complete). Socket.prototype.connect = function(options, cb) { ...... var self = this; var pipe = !!options.path; if ...
1
vote
1answer
38 views

How do I update each dependency in package.json to the latest version?

I copied package.json from another project and now want to bump all of the dependencies to their latest versions since this is a fresh project and I don't mind fixing something if it breaks. What's ...
0
votes
2answers
29 views

Trying to respond with text split into array of words from node.js http server

New to node.js, appreciate all the help you can offer. Trying to response out the variable 'words' but when I start the server and go to localhost it crashes and says " TypeError: first argument must ...
0
votes
1answer
47 views

Node.js server/client module confusion, EventEmitter woes

I'm trying to write a library which can be used in Node.js or on the client-side. I'm running into two issues: I can't seem to export it correctly. I'm using this doc. MyClass = exports? and ...
0
votes
1answer
49 views

Ajax post response from express js keeps throwing error

I am having a real hard time standing up bidirectional data transfer from a html page to my node.js application and then back to the html page. I'm pretty sure I'm all over the correct solution, but ...
0
votes
1answer
33 views

JavaScript nodejs mysql with queries in a loop

I feel a bit dumbstruck right now. I am fairly new to nodejs and javaScript and can't figure this one out. I guess it is because of the async nature of queries to mysql... I made an example that ...
1
vote
1answer
53 views

Node.js setting 'this' when running a function

I'm creating a module in Node.js that has an exported class function constructor. I added 2 prototyped functions to that class but I also have a bunch of free standing functions. The plain functions ...
-4
votes
0answers
39 views

what take in consideration when choose a new framework [closed]

I would like to know what to take in consideration when comes the moment to chose my next framework. In one way or another in the near future we should start working with one of the following ...
2
votes
1answer
30 views

Node.js stop playing audio

var fs = require('fs'); var lame = require('lame'); var Speaker = require('speaker'); var $stream = fs.createReadStream('sounds/test.mp3').pipe(new lame.Decoder).pipe(new Speaker); ...
0
votes
0answers
40 views

Securing client side templates [closed]

I'm building a web application with backbone+mongo+node.js The current implementation uses mostly client side templating with backbone.js to render the pages. Since the templates have to be located ...

1 2 3 4 5 123
15 30 50 per page