0
votes
0answers
4 views
how to asking questions in nodejs in command line
in ruby we can do it like this
print "How old are you? "
age = gets.chomp()
print "How tall are you? "
height = gets.chomp()
print "How much do you weigh? "
weight = gets.chomp()
puts "So, you're ...
0
votes
0answers
15 views
Using wepp LESS/JS preprocessor during development
I've been playing around with wepp, a very cool Node preprocessor for LESS and JavaScript. I only have one issue: when using the built-in @import functionality in JavaScript, there doesn't seem to be ...
-1
votes
1answer
8 views
Bower install command not working on windows
This is my output from running bower:
PS F:\tmp\ember3\demo2> bower install ember
bower cloning git://github.com/components/ember
bower cached git://github.com/components/ember
bower fetching ...
0
votes
4answers
37 views
How to print a html page received from the server?
I am attempting to print a HTML page which I have generated using Node.js at my server. I have brought the page to client side as a response to an AJAX request and have it in a javascript variable.
...
0
votes
1answer
21 views
MongoDB and nodejs, find throught list of ids
I have two collections:
users:
{
_id: ObjectId('123...'),
docs: [
ObjectId('512d5793abb900bf3e000002'),
ObjectId('512d5793abb900bf3e000001')
]
}
docs:
{
_id: ...
2
votes
3answers
35 views
How to end on first async parallel task completion in Node?
I have a list of tasks that I want to run in parallel using https://github.com/caolan/async.
I want the program to proceed (probably through a callback) after the first of these parallel tasks is ...
0
votes
0answers
21 views
Backbone / Express POST Routing
I'm currently working on a project that uses Rendr and am having some issues with routing POST requests. Below is my routes.js file - how can I make it detect POST requests as per GET requests?
...
0
votes
1answer
16 views
Meteor on windows - Server crashes on code push
I installed Meteor for windows from here :
http://win.meteor.com
The server crashes almost every time I try to make live code push.
I would then have to end the mongod.exe process and run 'meteor ...
0
votes
0answers
19 views
Dumping a full expansion of a complex data structure [duplicate]
In node.js, console.log on being given an object or array instead of a string, will dump an expanded representation of same, which is good. However it only goes down a couple of levels before it stops ...
5
votes
2answers
41 views
Node.JS Wait for callback of REST Service that makes HTTP request
I am using express module to make a Restful API within Node.JS. In my service I am making additional http requests to outside Endpoints(server side) and I need to return the data from those http ...
0
votes
0answers
13 views
MongoDb insert via Node.js Native Driver not inserting
I'm trying to get some data to save into MongoDb. I followed the following example beforehand and verified that it works, however now that I'm trying to write my own test app using this "format" it's ...
3
votes
2answers
38 views
why is it ecmascript instead of javascript and why do ecma websites look like they are circa 1999?
Since JavaScript is becoming more and more popular I'm wondering who are the people who get to decide what the language looks like, and why do we have ECMAScript instead of JavaScript? The ECMA sites ...
0
votes
0answers
7 views
passport authentication failure leads to redirect loop
I am using node, express and passport with facebook authentication.
I have the following routes (when /facebook/auth/callback is the callback url):
function render(page, req, res) {
var user = ...
0
votes
1answer
52 views
Node.JS function the returns http response value
I need to call a function that makes an http request and have it return the value to me through callback. However, when I try I keep getting null response. Any help?
Here is my code:
var url = ...
0
votes
2answers
19 views
Packing a node bash CLI for execution from the /usr/local/bin/ folder
Does anyone know how to achieve being to execute a node bash proram from the command line, for example the way you might call "brew install" - normally, you need to call "node NAME_OF_CLI".
The ...
0
votes
1answer
22 views
Assigning value to a global variable inside a callback function and returning it [Node.js]
I have an xml file with leagues there xml tree is so nexted with so many nodes but i want to return only the id and the name of each leage, i am using the xml-object-stream node module that can be ...
-2
votes
1answer
44 views
Using 'require' in node.js to include functions from another file [closed]
I use nodeJS, and I put this in the head of the file main.js:
var par = require("C:/Us/ht");
In the ht.js file, I have a function called doJob().
When I then try the following code in main.js:
...
0
votes
0answers
39 views
Find by specific code results in null
I'm very new to Nodejs and i'm trying to find a record in my db(mongo) by submitting a code and crosschecking the record to see if it exists.
I'm not really clear on how to approach this to get to an ...
1
vote
2answers
50 views
JS function prototype out of context node express
I have an issue using prototype in node with context.
/**
* Constructor.
*
* @param object opts The options for the api.
* @param object config The application's configuration.
...
1
vote
1answer
62 views
How to have javascript that can't use window.* methods [duplicate]
I am creating a new project called "Burn". This will be similar to Khan Academy's Computer Science program. How could I have a "private" JavaScript context that cannot use any methods other that those ...
0
votes
1answer
38 views
With node.js how to I set a var to response from HTTP client?
I know this is probably Asynchronous Javascript 101 and I do have some books on the Kindle I could consult, but I am nowhere near my device.
I have a node app with a variable being assigned to a ...
0
votes
0answers
17 views
Node and Socket.io App is running on Nodejitsu But Not Functioning
I have a simple Node.js and Socket.IO app with two Html pages(index, admin). It is running perfectly from installed Node server on Ubuntu 12 laptop. I deployed the app on Nodejitsu and the app is ...
2
votes
4answers
58 views
Javascript Promise node.js?
I'm a node.js newbie and I'm trying to understand how I can organize some logic in the non-blocking way node likes it.
I have a set of environments ['stage','prod'], and another set of parameters ...
4
votes
2answers
37 views
Interpretation of javascript code - Tilde symbol in front of ternary IF operator
I was checking the code of respons.js in express and came across this code:
res.contentType =
res.type = function(type){
return this.set('Content-Type', ~type.indexOf('/')
? type
: ...
0
votes
1answer
37 views
Parsing JSON url with NODE.JS and keeping it up to date with SOCKET.IO
I am very new to node.js and socket.io and I am trying to figure out how to read a JSON array from an external url, then parse it and display on the main page. Then I believe I use socket.io to keep ...
1
vote
2answers
24 views
Getting everything stored in Redis and sending it to a template
I'm building a little Node.js app, and one of the things I need to do is fetch all of the data in the Redis datastore and display it on this specific page. So far, my code looks like this:
...
0
votes
1answer
44 views
Getting the child key names of a JSON object
I need to get the xpath of json (ie) basically i need to get the keys of the jsons along with its xpath.
var json='"glossary": {
"title": "example glossary",
"GlossDiv": {
"title": ...
1
vote
1answer
27 views
CoffeeScript override base types, change value
I have a function that override primary types in CoffeeScript, but this function returnin value and I want to change itself.
String::replaceAll = (what, to) ->
regexPattern = new RegExp(what, ...
0
votes
1answer
23 views
How I can get multilingual values of a variable in a string with NodeJS?
In NodeJS, I am getting tags comma seperated, an in my model, split them and save to DB.
var getTags = function (tags) {
return tags.join(',')
}
var setTags = function (tags) {
return ...
0
votes
0answers
29 views
Is this Node (Express) implementation secure?
Some questions:
Is this implementation of Passport for Node.js (Express) secure?
Is it a correct implementation of REST?
Can I store state in the session in this way?
...