0
votes
0answers
8 views
Phantom.js / Casper.js with rotating proxy?
I have a simple goal: load webpages with either phantom.js (out of the box) or casper.js (nice and easier) but using proxy and rotate it from a list if current one is bad (i.e. webpage loads fail or ...
1
vote
2answers
43 views
Why does this callback with a timeout fails to return?
function one(num, callback) {
return callback(num);
};
function two(num) {
// return num + 99; << this works
setTimeout(function() { return num + 99; }, 1000); // << this doesn't
};
...
0
votes
0answers
9 views
Comparing arrays from Mongoose using ShouldJS
Taking an array such as ['hello', 'there'] and storing that in a Mongoose document with a schema such as
tags: { type: Array }
using something such as:
Something.create({ tags: ['hello', ...
0
votes
0answers
7 views
socket.io in node.js: socket.emit doesn't complete before socket.disconnect
I'm trying to use node.js as a server with socket.io (over a https connection server object, client connecting with option secure: true) with a JavaScript front end.
On the server if a login attempt ...
-1
votes
1answer
32 views
Difference between equal, deep equal, and strict equal [closed]
Looking at this page, I was wondering exactly what's the difference between equal, deep equal, and strict equal?
0
votes
0answers
9 views
Using an exposed object as value or helper in Express.js with jade templating?
I'm exposing (for testing purposes) an object and a named function:
var express = require('express')
, expose = require('express-expose')
, app = express();
// ...
// Expose with 'utils' ...
-7
votes
0answers
84 views
What 20% of Javascript does 80% of the work for your apps? [closed]
I have been learning JS for a few months. I have been through multiple tutorials online, read JS books, and build a few sites locally with Nodejs. My end goal is to be able to build web apps with JS ...
1
vote
1answer
44 views
Node.JS Can I sandbox or limit what a Function can access?
I have a Node.JS instance that dynamically inserts Javascript snippets to be executed from a Database where they are stored as strings. My problem is that I need to be able to Sandbox the executed ...
0
votes
0answers
25 views
How to HTTP get request with parameters in node.js?
Im working with NODE.js Im using 'request' module :
It works:
var request = require('request');
request('http://www.site.com', function (error, response, body) {
if (!error && ...
0
votes
0answers
13 views
Cannot Integration Test Thingdom neo4j Module
I was struggling to include the the neo4j thingdom module in my unit testing (question: How can i use sinon to stub functions for neo4j Thingdom module) so i decided to abstract it out and create a ...
2
votes
1answer
17 views
Make an AppJS project into a single exe
I have been reading online for days and I am unable to find a solution for this that I can get working.
I would like a single exe file that unpacks to temporary location when you run the file which ...
0
votes
1answer
28 views
How browserify makes Node.js modules to work in the browser?
Ii really can't understand some work behind browserify. When using pure JavaScript modules it seems "easy" to convert it to browser code, even if with many dependencies.
But browserify does more:
...
1
vote
2answers
30 views
How can I make a node.js server accessible to others on my network?
This is a pretty straightforward question. Normally in a node app, you put http.listen('1300', '127.0.0.1);. Is there some way to do this so that other computer on my network can access the server?
I ...
1
vote
2answers
55 views
Is this some sort of javascript array initialization and why?
I'm working through a javascript(node.js) example that saves to a mongodb db store.
I've come across a snippet of code and I can't quite understand what exactly the writer of the tutorial is trying ...
1
vote
2answers
37 views
JavaScript object properties count limit, deleting oldest updated ones
I would like to implement a size limit for JavaScript objects and their properties count. What I need is to delete oldest updated one when a new property is added to an object.
Consider the following ...
3
votes
4answers
48 views
What is the most efficient way to convert an integer to the fractional part of a number in javascript?
I want to convert an integer to the fractional part of a number using javascript.
For example:
10030 -> 0.10030
123 -> 0.123
I've come up with two ways of doing this:
var ...
0
votes
0answers
24 views
Is it safe to use Domain in Node for exception handling?
Currently its in Stability level: 2 which is Unstable, Is it recommended to use it?
Is there any other alternative for this?
-2
votes
1answer
34 views
Read txt file's lines in JS (Node.js)
I want to read a text file (.txt) using Node.js. I need to push each of text's lines into array, like this:
a
b
c
to
var array = ['a', 'b', 'c'];
How can I do this?
0
votes
1answer
61 views
a variable is not defined but i initialized it before
I write a client with nodejs and javascript.when i debug the code the console says that the X1 variable of coordinate is not defined, but i initialized it before.who can explain it for me?
the ...
2
votes
1answer
30 views
MongoClient TypeError
I am a NodeJS newbie and JS can-kicker trying out DI for the first time. Here are the questions I looked at before deciding to ask mine, since they show the same error: [1][2]
Running my entry point ...
0
votes
0answers
11 views
Building Dynamic Querys Mongoose nodejs
Good afternoon, I have a small nodejs app that takes string and splits it into a array of keywords. I want to query a mongodb collection using mongoose. Here is what I'm looking for but in SQL format. ...
0
votes
1answer
36 views
WebRTC, JS, node.js App working locally through remote server but not different connections
I have recently started to look at inter-browsers communications, and got paricularly interested in webRTC. I am trying at the moment to build a file transfer through a Data Channel with the beginner ...
1
vote
2answers
28 views
Node,express,jade rendered pages doesn't data-bind with knockout.js
I'm running a Node server with express which renders jade. I'm trying to make my client side use knockout.js but the view never updates... I don't get any errors in the console and I just can't figure ...
1
vote
1answer
42 views
Memory leaks in nodejs websocket server
I'm using websockets to transfer video files, this means they are large files.
The server side (and also the client side) is implemented using nodejs, with binaryjs in javascript.
It worked fine, ...
0
votes
0answers
31 views
JSON Building in Node.js with YQL parsing
Respected ppl ....
This is my node.js code ...
https://gist.github.com/SkyKOG/99d47dbe5a2cec97426b
Im trying to parse the data of our exam results ...example ...
...
0
votes
1answer
23 views
How can I prevent malicious use of my sockets?
I'm making a webpage based around players being able to invite other players to parties, and other things a long the lines.
I have your basic send / receive / update of the chat/users in your party. ...
1
vote
0answers
25 views
run three.js on server with a help of node.js, export model to json and load to end user through ajax
i have a javascript app, that i wrote,where i want to protect the drawing mechanism of the model and make mechanism not available to public.
So i come up with a solution, where i want to run ...
0
votes
2answers
56 views
how does socket.io work? [closed]
I am using socket.io and it was quick to use (thanks to examples on their usage page) but i'd like to find out more about what exactly is going on under covers and what's the technology that makes it ...
0
votes
1answer
20 views
Missing stack trace on node.js uncaughtException generated by throw()
I'm trying to catch the stack trace of an node.js uncaughtException and it works fine for different errors but not for throw() statements:
Correct stack trace on exception handling:
$ cat ...
0
votes
1answer
15 views
Scope issues with populating array from multiple mongodb calls
I have a game grid that I'm trying to fit into an array of rows each with a number of blocks. The blocks are stored in the same collection and have row and column fields.
My current attempt is as ...