Tagged Questions
0
votes
0answers
5 views
Nodejs retrieve a variable
I would like to retrieve the variable "users" outside the function:
var users;
client.lrange("comptes", 0, -1, function(err, replies) {
replies.forEach(function(reply, i) {
users ...
0
votes
0answers
7 views
Nodejs throws error when executing QUnit test
I am using node-qunit from https://github.com/kof/node-qunit
But, when I execute the command
$ qunit -c ./pdmm.js -t ./tests.js -d sinon-1.6.0.js sinon-qunit-1.0.0.js jquery-1.6.2.min.js
I get the ...
0
votes
0answers
7 views
get browser client certificate in node.js with socket.io and https module
I am using the following test code to setup an ssl based socket.io server in node-
https = require('https');
fs = require('fs');
sio = require("socket.io");
var options = {
key: ...
0
votes
0answers
12 views
Get requests per second from node.js http server
Is there a way in node.js to get the number of open connections and number of requests per second from a http server?
Assume the following simple server:
http.createServer(function (req, res) {
...
-2
votes
1answer
21 views
Is there a way to replicate the Chrome Incognito Window using web technologies [closed]
I am wondering if there is a way to replicate the behavior of Chrome's private mode using we technologies. Let's say I want to run two web apps side by side in one tab of Chrome or any other browser ...
0
votes
0answers
5 views
Loading mongoosejs models from other data stores
I'm working on a project in Node.js with mongoDB and mongoose for the data layer. I was hoping to use Redis to cache the ID lookups so that mongo is free to work on the harder things. Specifically ...
0
votes
0answers
11 views
Unable to use process.env to get environment variable in ~/.profile or ~/.bash_profile in Mac
I am trying to get environment variables in a node.js (using node-webkit) application on Mac and I am unable to.
I added the entry
export MY_PROJECT=\Library\MrProject
in both ~/.bash_profile and ...
-1
votes
1answer
83 views
Where do I need a closure for this one?
I have this constructor:
var EditableItem = (function() {
function EditableItem(schema, item) {
this.schema = _.clone(schema);
this.item = _.clone(item);
...
2
votes
1answer
34 views
SetTimeout issue in Node.js
I've the following code which runs fine under Chrome (V8) but fails inside node:
var id;
id = setTimeout("TimeoutHandler()", 10);
console.log ('SET');
function TimeoutHandler()
{
clearTimeout(id);
...
0
votes
2answers
35 views
Control flow: Run two asynchronous array maps
I have two functions that are asynchronous – they accept a function as a parameter which it called when it is done (callback).
function a(item, cb) {
someAsyncOperation(function () {
cb(item)
...
3
votes
0answers
36 views
Video stream through Websocket to <video> tag
I use Node.js to stream via Websocket a realtime webm video to a webpage which will play it in a tag.
The following is the code from both the server and the client:
SERVER:
var io = ...
2
votes
2answers
23 views
Finding process id of a Node.js server in Windows
To find a process id of a node.js server in unix, we use below code:
if (process.getgid) {
console.log('Current gid: ' + process.getgid());
}
So I get output as 1888 in *nix OS, but when I ...
0
votes
0answers
28 views
Backbone fetch, calls both error and succes
I'm new to Backbone and I was trying to retrive an JSONP from a nodejs server.
My problem is that both error and succes methode are called. Can you please tell me what am I doing wrong?
var ...
0
votes
0answers
31 views
Angularjs on server
Is it possible to use angularjs services like $q and $http on server side nodejs code? I have to frequently share code between server and client making it necessary to use libraries that work both on ...
0
votes
2answers
33 views
Minify / Combining all JS files from directory
I am new to uglify-js. I want to minify all javascript files from src/js/ directory to lib/js/. Is there any command to minify all js files directory?
Thanks in advance.