-1
votes
1answer
11 views

javascript setter injection without eval

I'm trying to use a setter injection in this example below, it works but I cannot yet find out how to achieve the same result without using eval(). var action = function(){}; action.prototype.create ...
0
votes
0answers
8 views

How do I make an xhr soap request in nodejs?

How do I make an xhr request in Node.js? This is my js file: var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; var url="https://xx.xxx.xxx.xxx/server"; function soap() { var ...
0
votes
1answer
17 views

How to achieve maximum web security here

We have a browser front end that communicates with a Node.js server which stores data in a MongoDB database in a BlueMix cloud. My bosses really don't want data being seen by intruders. None of us ...
0
votes
0answers
10 views

run bower install for target bower.json file

Assume that my working directory is c:\foo\ during the script execution. I would like run bower from there for c:\foo\bar\bower.json file. This is available on npm by running npm install --prefix ...
0
votes
0answers
10 views

Node.js + Mustache to Preprocess Static HTML

I'm working on a project that requires static HTML pages to be converted into new static HTML pages. I scraped the pages with Cheerio for content and stored the relationships between pages as JSON. ...
0
votes
1answer
20 views

Prevent file corruption on exiting node in middle of fs.writeFile

I'm reading and writing some txt/json files in Node.js that have become >25mb in file size. If the process is interrupted half way through an fs.writeFile I get an empty file. So basically, I'm ...
-1
votes
1answer
16 views

Decoding & from all incoming requests to my node js app

Is there an easy way to detect and decode all encoded characters in any url coming to my node app ? can it be done with a middleware that fetch and decode symbols like & ?
-1
votes
1answer
18 views

Sending a confirmation email with Node

I created a script that lists all directories and files from my application and send to my bucket in s3(a backup). I needed a package to send me an email when this happens. Does anyone know a node ...
0
votes
1answer
27 views

Elegantly hiding the navbar in a single page MEAN app.

I have an app that has a navbar on everypage, so I factored it out into index.jade that inherits from my layout.jade file. This is fine for 99% of my app. The only place it runs into issues is on ...
-1
votes
0answers
7 views

Using mongodb api in node.js - what does assert do?

I'm reading the mongodb docs for connecting to mongodb: var MongoClient = require('mongodb').MongoClient , assert = require('assert'); // Connection URL var url = ...
0
votes
0answers
9 views

Trying to create Meteor package from node-canvas npm module

Hello I'm trying to create Meteor package that will introduce Canvas on server side. I've used node-canvas Npm module and after some problems with ...
-1
votes
0answers
16 views

Meteor.js on Openshift Quick Start Guide fails?

Trying to load a Meteor.js leaderboard example app to Openshift using this quick start guide: https://github.com/openshift-quickstart/openshift-meteorjs-quickstart I am forcing meteor to use v 0.6.0 ...
0
votes
1answer
8 views

Is it possible to forward a stream from one function to another?

Please have a look at the following sample code. As you can see, it uses busboy to parse incoming form data and write incoming files to disc. Let's assume these are just image files because my sample ...
0
votes
1answer
16 views

Random chat with Socket.io, like Omegle

I have succesfully installed node.js and socket.io on my VPS. I have written an very simple and basic chat that I want to extend from time to time. I know you can make chatrooms, but I don't want user ...
0
votes
0answers
15 views

Node.js: Mongoose skips update instructions in async loop

Based in an async waterfall structure (MEAN system with Mongoose), I initiate a series of actions. One of the last ones keeps giving me a headache. From a form, I post JSON data to create an author ...
0
votes
1answer
24 views

Convert a decimal number represented as a string to its hex format still representing it as a string

I'm trying to do operations in 160 bit integers using the bigInteger.js library, but I want to keep a representation of those in hex format so I can transmit them over and use them as ID. var ...
1
vote
1answer
16 views

Node js offline speech to text

I want to create a robot with Node.js and Tessel.io, i bought the audio module and i'm wondering if it exist any speech to text or audio to text package for node js or something else. Can someone ...
0
votes
0answers
9 views

i get an empty value when using formData with MEANJS

i get an empty value when using formData with MEANJS , i used to use the following code to get data from any form including the "files" as well , var formData = new FormData($("#myForm")[0]); I ...
0
votes
0answers
26 views

How to insert an element to the middle of an array with MongoDBv2.4/minimongo

I'm writing a music organization app with the latest version of Meteor (A new web framework.). I think that the best way to store playlists is to put each playlist in a document and put the items of ...
0
votes
1answer
11 views

nodejs events is being called multiple times

I have been working on an CMS on nodejs hosted at https://github.com/techunits/mopublish/tree/develop. Here I have added few event hooks e.g. mpObj.emit('MP:FOOTER', '<center>MPTEST Plugin ...
0
votes
1answer
14 views

Google Universal Analytics - setting custom attributes

I am attempting to use Google Universal Analytics API to track events (https://developers.google.com/analytics/devguides/collection/analyticsjs/). Is it possible to send/force some attributes, like ...
0
votes
0answers
23 views

Receiving an event that occurs in another file

Sorry for my english this is a google traductor I come from java and i am newbie in javascript. In java you can create a listener in a class and get that event in other class... How can i do that?? ...
-1
votes
0answers
14 views

Get user input from HTML to node.js

this is my node.js code: var http = require('http'), url = require('url'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); res.write('<form ...
0
votes
0answers
13 views

Nodejs multiple request in a row

I'm developing nodejs application with users registration using sails. I have an /signup method, which is looking for existing user, if user not found, it will create new user in db. As you know in ...
2
votes
1answer
26 views

How to convert function call with two callbacks to promise

I have a function like this: var f = function(options, successCallback, errorCallback) { ... } and I want to convert it's call to a promise. My current solution is this: var deferred = ...
-2
votes
7answers
51 views

Parse JSON Array Object into a JSON Object in Javascript

I have a JSON Array Object in the following form {"Object1":[ {"field1":"label1", "field2":"Name1"}, {"field1":"label2", "field2":"Name2"}, {"field1":"label3", "field2":"Name3"} ]} I ...
0
votes
0answers
6 views

“Sandbox” for using multiple instances of a javascript lib

I'm using a js lib, which will create a global variable "AV" used everywhere in a WebApp. But I want to create a "sandbox"(not actually a strict sandbox because of no secure concern) to use multiple ...
0
votes
1answer
32 views

What all is passed on clicking the submit button of a form?

I am using node.js with jade templating engine. I am having a form in jade as follows: form.form-signin(style="padding-left:10px", action='/update', method='post') ...
0
votes
1answer
41 views

Modify NodeJS core programs

I tried to add some custom functions into the FS module of NodeJS, this module is part of NodeJS' core programs. I found the corresponding file (fs.js) in the following location: /usr/lib/nodejs. The ...
0
votes
0answers
11 views

Are there any best practices for folder structure with Harp.js and GitHub pages?

I'm using Harp to create a static website that shall be hosted on GitHub pages. So far, everything works, but I'm a little bit concerned about the folder structure. This is because GitHub pages ...
0
votes
0answers
9 views

Pusher - Client to server events like in socket.io

In socket you can do Server: socket.on('event1', callback); Client: socket.emit('event1, 'hello world!'); Is this sort of thing possible in pusher? Note: i've tried subscribing to a channel ...
0
votes
2answers
18 views

LearnYouNode: Callback Keeps Returning True for Err

This is for the Node.js course on LearnYouNode. This challenge was: Juggling Async Here is my code: var http = require('http') var concat = require('concat-stream') var urlHolder = []; /* ...
0
votes
0answers
17 views

Gulp-filter in one stream not delivering all files for dest

In gulp I’m currently trying to batch copy, move and apply plugins to a bunch of src files for a build process.Trying to use gulp-filter to split the required files up for each step and applying the ...
0
votes
1answer
15 views

How to make frisby.js scripts “pause” during chained executions of apis

I want to test a session timeout using Frisby.js. So I want to call our login API and call an API to demonstrate the user is logged in. Then I want frisby.js to wait 20 minutes for the session to ...
0
votes
0answers
34 views

How to kill an async child_process in Node js?

I want to run a simple shell script from node and do something with the output. However, child_process never seems to exit and I have to control-c my program every time. I've fiddled around with this ...
0
votes
0answers
31 views

Node.js - strange TypeError when function being called twice within class

Consider this (simplified) extract from a class: function PluginsEngine() { this.allPluggins = require('./plugins'); }; PluginsEngine.prototype.applyPlugins = function(incomingData, done){ ...
0
votes
2answers
37 views

javascript while loop giving different results in node and browser

I am executing the following seemingly straightforward code var number = 0; while (number <= 12) { console.log(number); number = number + 2; } and I am getting different results in ...
0
votes
0answers
14 views

emailjs TypeError: undefined is not a function /emailjs/smtp/client.js:118:16

I am having a wierd issue with nodejs, I have it installed n my desktop development environment and it is working fine. I have ported the same code across to my unix test environment and get the ...
0
votes
1answer
13 views

Mongoose Schema for remote MongoDb

I'm fairly new to Mongoose, so bare with me if this is obvious: I have opened a connection to my remote mongodb ec2 instance but now am trying to retrieve data that is nested within a collection. ...
2
votes
2answers
45 views

Need help on how to actually use Passport authentication strategy in Express

Suppose I have a script like this, which uses a Passport authentication strategy with an Express backend. How would I use this script to actually make API function calls? I don't see any explicit ...
0
votes
1answer
29 views

Message callback returns a value infrequently - Chrome Extension

I'm building a chrome extension which communicates with a nodejs server through websockets. The point of it is to track browsing history with content. It all seems to work, but occasionally (30% of ...
0
votes
0answers
40 views

Why Q promises with mongodb are not called

I'm using node.js, Q and mongodb [i think my code looks well]. I can't understand why i can't access the places where i put the tags [breakpoint]. I can't understand why promises refuses to return ...
0
votes
0answers
28 views

Saving arrays in mongoDB using mongoose and node.js

I'm trying to save an array of arrays into my mongoDB collection. Below is a snippet of the users schema I'd like the arrays inserted to. tracks: [{ track_id: { type: String }, ...
0
votes
0answers
12 views

Using PDFkit in browser, inserting an image from a link

Is there a simple way to get an image from a url to put in a PDFKit pdf? I have a PDF being automatically generated in-browser. There's an image I want included, to which I have a URL. The catch is ...
0
votes
2answers
22 views

Node Stream: Not passing Callback Function a Value

I am working on nodeschool.io's learnyounode http client exercise. This is the task: Write a program that performs an HTTP GET request to a URL provided to you as the first command-line ...
0
votes
1answer
46 views

I am not able to convert a string into a jasvascript object

Maybe it is an easy topic, but I am trying and trying and I am not able to do this. I want to convert a string to a javascript object. Since now I tried multiple forms to resolve it. I am working with ...
0
votes
0answers
10 views

Grunt: Error: Cannot find module './util/task'

I am having a problem getting grunt to work on my linux box. I checked the node_modules folder and there is a folder missing from the grunt source. This does not happen on my local machine. Grunt is ...
0
votes
0answers
12 views

Requiring jQuery and lodash with browserify

I love the idea of browserify, but I'm having trouble wrapping my head around requiring 'global' variables, like jQuery and lodash. I would expect: // application.js var $ = require('jquery') var _ ...
0
votes
1answer
15 views

How can I truncate a string to a maximum length without breaking ANSI escape codes

I have a child process in Node.js which is producing ANSI-escape coloured output which is sometimes wider than my terminal. I want to truncate the long lines, but without breaking the ANSI colour ...
0
votes
1answer
53 views

AngularJS + Bootstrap Pagination

I have all my data in multiple JSON: http://localhost:3000/images?page=1 http://localhost:3000/images?page=2 http://localhost:3000/images?page=3 ... So with AngularJS I would like a pagination ...