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.
0
votes
0answers
5 views
NodeJS unindent repl
When prototyping a function in the nodejs repl I am unable to get back to the actual repl after completing the function like so:
> function build_color_pallete(ruleLen) {
... function ...
2
votes
3answers
21 views
javascript programatically construct JSON element
I am trying to construct a JSON object of the following form in javascript:
var sample_rule = {
"rule1": [
"color": "#CAFEBABE",
"label": "extended rule 1",
"percentage": ...
0
votes
0answers
4 views
Is there any Dependency Injection solution for nodejs similar to angular injector
Angular injector is awesome and it would be great to find to use the same concept in the backend. Is there something similar?
0
votes
1answer
12 views
Get two letter continent code from ip address with JavaScript/Node.js
I'm writing a JavaScript/Node.js application that needs to place items in a continent based on an IP address I receive. PHP has a geoip_continent_code_by_name function which does exactly what I want ...
0
votes
0answers
7 views
Set module exported MemCached object in a callback
I'm working on a utility module for memcache use, but since you are supposed to set module.exports immediately, not in a callback, I can't do it properly.
I tried:
var memcache = new MemCached();
...
0
votes
0answers
7 views
Terminating a child process in NodeJS on Windows
I have the following code, which launches Flash
var flashExePath = "\"c:\\Program Files (x86)\\Adobe\\Adobe Flash CS6\\Flash.exe\"";
var sys = require('sys')
var exec = ...
0
votes
1answer
30 views
Is there a way to prevent certain IP to connects with my Node.js ('net') server?
Im using a very basic script of a server with node.js and Net module...
Im receiving suspicious connection from IP. I can add all ips that I dont want connected... Its automatic: When the user dont ...
1
vote
1answer
11 views
Private, local (and app specific) modules
I have a Node.js app with following structure:
+
|-- app/
| |-- config.js
| |-- modules/ // MVC app modules/components.
| |-- login/
| |-- signup/
|-- lib/ // App ...
0
votes
1answer
10 views
Nodejs: use eventEmitter object globally
Lets say I have 3 exposed functions: user, posts, articles
all of which needs to emit messages to a file called mediator where all of the events are set.
Currently I'm have trouble doing so
In the ...
0
votes
0answers
10 views
node.js http-proxy how to set timeout and a handler on request
I am using http-proxy on node.js. I have a proxy request to another server. my requirement is that the proxy request should timeout in 10 seconds. Also when the time out happens, I should be able to ...
0
votes
1answer
16 views
mongo db isodate to node date output mismatch
newb wandering around node / mongo on localhost os x 10.6.8 Not using middleware as I want to understand what's going first.
Imported multiple documents into mongo. Attempting to find by date but ...
0
votes
1answer
13 views
Coffeescript, external file and Inheritance
Sorry about my english grammar.
I am written a simple BROWSER based script with Coffeescript.
but things start to get too messy and now I want to separete my classes on different files, to be more ...
0
votes
0answers
3 views
error handling using winston not returning response
I am using winston error handling in Node.js application
var logConfig={
level:'info',
timestamp:true,
colorize:true,
handleExceptions=true
};
logger = new (winston.Logger)({
...
1
vote
2answers
22 views
Union query in mongodb without using map/reduce
Yes, I checked other union questions here, however this seems to be different.
Here is the SQL query I'd like to convert for mongo
SELECT column1 from table1
UNION
SELECT column1 from table2
In ...
0
votes
1answer
7 views
Installing node packages globally offline
Environment: In a closed/offline environment.
Question: I am manually copying over node_module's and one of them needs to be installed globally. What is the process to do this?