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.
1
vote
1answer
5 views
sequelize.define error: has no method 'define' in nodejs
This is my managedb.js which manages all the database models:
var Sequelize = require('sequelize-postgres').sequelize
var postgres = require('sequelize-postgres').postgres
var db = new ...
0
votes
1answer
10 views
Is it possible to return only a certain fields when inserting a new document?
I nedd to get the new document back with _id field only. Something like this:
db.users.insert({name: 'Jonh', age: 27}, {_id: true} , function (err, user) {
if (err) {}
// need to be user with ...
0
votes
0answers
9 views
Node JS route not firing with multiple segments
OK so I am not sure exactly why this is happening. I tried searching for this but I am not sure how to word it - something like "multiple url segments not firing route." ?
Either way here we go...
...
0
votes
1answer
7 views
crypto.createCipheriv -> cipher.update + cipher.final does not return a Buffer?
I create a cipher passing two buffers. buf1 is they key, a 32 bytes buffer, and buf2, which is the IV, is also a 32 bytes buffer that I slice to only use 16 bytes. Documentation says that ...
0
votes
0answers
10 views
Encode MPEG Movie via Javascript/Webbrowser?
I have created a script in JS which creates video frames as separate images, which I would like to encode to a video format (eg. MPEG-4). What would be the best way to do that? I considered using ...
0
votes
1answer
15 views
Cannot find module in Node.js
I have folowing directory structure:
--app
-- test
-- server.js
-- app.js
I try to call function in app.js which exports from server.js, i do:
var server = require("test/server");
But ...
0
votes
2answers
17 views
How do you pass an argument to the iterator function for async.each?
I can't for the life of me find the answer to this. How do you pass a parameter to the iterator function for async.each using caolan's async.js node module? I want to reuse the iterator but it needs ...
0
votes
0answers
15 views
How To Understand Node.js Event Loops
Actually I'm learning node.js right now. Although I've learned many things about node.js like install modules and use them but I've not understood the actual core functionality (event loop and ...
0
votes
0answers
18 views
How do I add x-amz-acl:public-read to an Amazon S3 Secure Url
My scenario: I need to generate a secure url to hand to a client. That client will use the url to post a file directly to S3. The file should then be available to the public.
I am currently trying to ...
0
votes
0answers
5 views
EPERM, operation not permitted error, config store
I know this is a common error with node but all my troubleshooting techniques seem to be failing.
Windows 7 (32-bit)
[email protected]
[email protected]
This issue occurs when trying to run package commands ...
0
votes
0answers
9 views
Add to NODE_PATH on Heroku/Foreman
Is it possible to add NODE_PATH in Heroku/Foreman, I can't seem to find anything in the docs, and I'd like to load custom modules from my lib directory.
I've tried the following in my .env file and ...
0
votes
0answers
27 views
Is there a JavaScript platform with plugins and themes ( similar to WordPress )? [closed]
Do you know if there is a JavaScript based platform/framework that can be extended with plugins and themes?
I'm looking for features that are similar to WordPress or Django namely:
Free Admin ...
0
votes
0answers
11 views
Sailsjs “required” Model Attribute in the default JSON API
Should SailsJS be throwing an HTTP error if a "required" model attribute is not passed into the automatically generated JSON API?
Or is this logic I must implement myself in the Controller?
1
vote
1answer
18 views
trying to make a variable available to browser with socket.io
I've got an application that uses node/express/socket.io to mark tweets on a map. I'm also trying to include some sentiment analysis, so I'm using npm sentiment like this:
var sentiment = ...
0
votes
0answers
11 views
Powershell not working correctly via team city
Hi all I am having some major problems with power shell via team city.
I am running a grunt script via power shell in team city, which executes some sass.
Firstly all my scripts are running ...
0
votes
0answers
15 views
Ember Rest Adapter with node.js express and mongodb, can't do the right mapping for the model
I started to work on Ember, and I'm trying to make a rest adapter with node.js, express and mongodb.
I wrote this server.js file :
var express = require("express"),
path = require('path'),
users = ...
-1
votes
0answers
15 views
Node.js “Socket Hang Up” with https request
I have a web scraper that uses Node, resuest, Cheerio and saves to Mongodb.
It works by loading in JSON files, which contain objects that tell the scraper where to get information from. It then ...
0
votes
0answers
11 views
Autocomplete with nodejs , mysql , sphinx for a large dataset (~50k)
I have a large dataset which is stored in a mysql table , it contains only two fields , id and name , id is a primary key and name has a unique index . I used sphinx as an indexer , and i am querying ...
0
votes
3answers
42 views
JavaScript variables hoisting in nodejs/async
In the next example I don't have access to variable "locals" inside the functions "fetcher", "parser" and "saveToDb".
var parser = require('parser.js');
var fetcher = require('fetcher.js');
var ...
2
votes
2answers
37 views
Node.js class issue, or Am I doing something wrong?
this code
class Foo
bar: []
test = new Foo()
test.bar.push('b')
test2 = new Foo()
console.log test2.bar
Will produce output ['b']. How it is even possible?
Edit:
This is what CoffeScript ...
-1
votes
0answers
18 views
Need to send multiple requests to client from nodejs
I have a node server which basically acts like a server to hit another server and sends back the response .This happens synchronously.I dont want my client to wait for more than 5 secs for my ...
0
votes
1answer
25 views
Is directory traversal via request.url possible?
I'm coming from PHP, where you can inject double dots into a URL to try directory traversal. In NodeJS, it seems that you get the Http webserver automatically removes the double dots from the URL.
...
2
votes
0answers
12 views
Receiving data sent from AIR app in node.js server running on Heroku
I am trying to receive data sent from my client adobe air application in node.js server running on Heroku, but with no success.
This is how i am sending the data:
var loader : URLLoader = new ...
1
vote
1answer
20 views
load files from external modules without export
How to link another file from another module like that:
require('module2/file2_in_module2.js')
I created module module2 with 2 files: index.js and file2_in_module2.js. Run npm link. And in another ...
1
vote
1answer
18 views
Unable to install/run grunt 0.4 (Win 7)
I'm new to grunt and I've just tried to install it following the instructions on http://gruntjs.com/getting-started.
First I install grunt-cli :
npm install -g grunt-cli
In AppData/Roaming I can ...
0
votes
2answers
42 views
data passing over tcp between erlang and nodejs
I need data passing between nodejs and erlang process over tcp. Erlang process is kind of api server which receives data from nodejs process and does some processing.
I thought of using json as the ...
0
votes
0answers
10 views
Assistance with nodejs/express/supertest
New to NodeJS and Express3 ... working through the tutorial i found at:
http://www.scotchmedia.com/tutorials/express/authentication
It seems rather helpful but i seem to be having some difficulty ...
0
votes
1answer
14 views
Express, check if a template exists
Is there a way I can tell if a given template exists in express? Basically I want to create specific and fallback templates but don't want to contain that logic in the template itself.
if( ...
1
vote
1answer
22 views
How can I make a Grunt task fail if one of its sub tasks fail?
I have a build task in grunt, which looks like this:
grunt.registerTask("build", ["jshint", "uglify"]);
The problem is that the uglify task runs even if the jshint task fails, how can I make the ...
0
votes
1answer
20 views
async module with c++ v8 for node js,error associated with the types in the structure
I am writing asynchronous module, but I can not pass an array structure. Please help. That's the error appears. How to avoid it?
error C2440: '=' : cannot convert from 'v8::Handle' to 'v8::Array *'
...