Tagged Questions
Node.js is an event-based, non-blocking, asynchronous I/O framework that uses Google's V8 JavaScript engine and libuv library. It is used for developing applications that make heavy use of the ability to run JavaScript both on the client, as well as on server side and therefore benefit from the re-...
0
votes
0answers
4 views
Poor Parse Server performance due to Expressjs Middleware: jsonParser
One of my Parse Server cloud functions is performing very poorly, and I am hoping someone could help point me in the right direction to begin debugging the reasons why so I can fix it.
I used New ...
0
votes
0answers
8 views
node express handling POST and GET as a single request
I would like to handle both POST and GET requests as a single request, such that all of my routings and subsequent functions only need to process a single request, rather than duplicating everything ...
0
votes
1answer
5 views
How to create a Bootstrap Sass project
I know that could be multiple answers for this question but I would know how i can fast setting up project with Bootstrap and Sass.
I had never used node, npm, grunt or bower, I've installed all ...
0
votes
0answers
5 views
Can't use ESLINT because of PATH. How to change it?
I'm using Sublime Text 3 with iTerm2 and zsh (oh-my-zsh). I use homebrew and yarn.
I do all my processes without problem. Npm install? Works. Yarn gulp serve? Works. Even the ESLINT inside my gulp ...
-1
votes
1answer
9 views
How to insert an Object into MongoDB
So I have an object using a dictionary to store products that a user has added to the cart in a shopping cart application. I am taking is object and attempting to insert into mongoDB with zero luck.
...
0
votes
1answer
10 views
node.js server show user raw html code
I am working on a simple server that stores files and lets you view them by typing the file name after the IP, e.g. if I want to see pic.jpg, I can go to
192.168.1.88:8000/pic.jpg and it will show you ...
0
votes
0answers
8 views
How to rewire multiple modules in the same file
I want to do something like
allModules = rewire '../path/to/file'
allModules.module1.__set__ 'methodName', ...
or something like
{module1} = rewire '../path/to/file'
module1.__set__ 'methodName', .....
0
votes
0answers
7 views
How do I get current user session when I upload/save a file using multer?
I have the file upload working and saving properly. My current problem is that I need the file name to contain a user ID or username so I can keep files separate for each user. Heres my current setup ...
1
vote
2answers
38 views
How to differentiate a function from a class object?
I have a js object that could be a function or a class, ie. it is equal to one of:
class {
constructor( param ) { }
onCreate() { }
};
Or,
function ( param ) { };
Turns out they have more ...
0
votes
0answers
4 views
Using node as api and static
I'm extremely new to web development. I've bought a domain name (let say 'domain.com' and what I want is to have two links: one 'api.domain.com' with MySql database and Node server for API; and second ...
0
votes
0answers
15 views
Pitch detection - Node.js
I'm currently developing an electron app, which I hope will be able to measure the pitch of guitar input on desktop.
My initial idea is one tone at a time so please let me know if FTT is appropriate....
0
votes
0answers
5 views
How to make interactive skillsets with Alexa
How do I make a interactive skillset for Alexa? It was easy to spin a non-interactive style skillset in no time with little help. The moment I try to make it interactive, first skillset slips to ...
0
votes
0answers
20 views
Node JS I/O threads
If Node JS also uses a I/O thread in libuv to perform IO, how is that thread different from a thread created by IIS when it receives request for simple I/O?
0
votes
0answers
20 views
Large csv parsing CPU improvement
I have around 150mb csv file that i need to download, parse and process every 5 minutes. However i am looking to reduce the cpu intensity of this operation as on AWS instance it's eating up around 15% ...
0
votes
0answers
4 views
Thinky is not reconecting automatically after ECONNRESET (RethinkDB)
I will explain my issue:
I run my NodeJS App development envirement with:
SO: Windows 10
NodeJS: 4.4.5
RethinkDB: 2.3.5-windows
Thinky: 2.3.8
I follow the next steps:
Start the RethinkDB database
...
0
votes
0answers
8 views
Serverless: You're using the LAMDA-PROXY in combination with request / response
Could someone please help explain what this warning message means?
Serverless: Warning! You're using the LAMBDA-PROXY in combination with request / response configuration in your function "indexPage"...
0
votes
0answers
7 views
Mongoose-Paginate - Sorting by a populated field
I am using mongoose-paginate to get a list of records sorted by a field which was populated from a reference.
// models
const Company = new Schema({
name: String,
type: String
});
...
-4
votes
0answers
22 views
Learn Node.JS or stick with c# Restful API?
I'm sure many have asked this question. I'm really good with C# and have build many applications with C#, MVC, Windows Form, Web forms and etc. Lately, I've been given a task to build a Restful API ...
0
votes
1answer
11 views
Mongoose, Filter list of object before $setIsSubset
Right now I have an aggregation like that
Element.aggregate([{
$redact: {
'$cond': [
{
'$eq': [
{ $setIsSubset: ['$elements.element', myElements] ...
0
votes
0answers
18 views
Extract text from HTML String Node.js
I'm building a CMS and the content of a post is saved in HTML in the database.
On the page that lists posts, I would like to show the first n words / n characters, for the short version of the post ...
0
votes
1answer
14 views
pipe works on localhost but not on remote nodejs
I'm trying to use ytdl-core module in order to download youtube audio to my local disk (some path on my computer).
I created an API to which I can call with the requested youtube url and the ...
0
votes
1answer
23 views
Promise Chain not waiting for promises to resolve before ending
I've tried to simplify these down a bit:
passData.savedDBGames.forEach((gameInfo) => {
return new Promise((resolve, reject) => {
stats.getPlayersStats(gameInfo.fixtureID)...
0
votes
0answers
15 views
Invoking a node module from react component
How do I use Node Modules for example 'lwip' in React component ? This is for an electron application.
-1
votes
1answer
23 views
How to listen to GET requests using only http with node? No express
I'm wondering how to listen to http get requests with only "require http" instead o f express.
This is what I have now:
let http = require('http');
let server = http.createServer(function (req, res) ...
0
votes
0answers
10 views
Skype Bot node.js error 500 on test connection
I'm trying to create a Node.js based skype bot, but when I hit "test" on botframework I always receive this error
500 InternalServerError
System.Net.Http.HttpRequestException: An error occurred ...
0
votes
0answers
16 views
Issue with a node module when building Angular 2 application
I have a seed project:
https://github.com/mgechev/angular-seed
I am trying to build a production build of the app using:
$ npm run build.prod
I am using a module that I have installed using:
npm ...
1
vote
1answer
9 views
How to distinguish between two web clients on the same IP
I need to create a temporary working space for each client that is not logged in (a folder on the server) before the client logs in.
I am currently using the ip address to create an object but there ...
0
votes
1answer
14 views
Highcharts in Node
Has anyone had success using Highcharts in Node.js? I'm having the following issue using [email protected] :
var Highcharts = require('highcharts'),
chart = Highcharts.chart(null, {
series: [{
...
0
votes
0answers
5 views
Node Devtool Reload console on file change with --watch
This hadn't occurred to me as a wanted feature. But when using devtool on Ubuntu whilst using the --watch param the console would reload.
Now I'm on Windows 10 and the console stays there meaning ...
1
vote
2answers
16 views
ExecJS::ProgramError in Welcome#index
On Ubuntu 16.04 with Ruby 2.3.3, Rails 5.0.0.1, and NodeJS 4.2.6 installed, I generated a toy controller with bin/rails generate controller welcome index. After running bin/rails server, I opened http:...
0
votes
1answer
9 views
Failed to load resource in Node JS
I am doing a tutorial trying to learn Node and Angular. I am completely new to this, I come from a LAMP stack environment so it's a whole new world to me and I feel completely lost.
I have installed ...
0
votes
1answer
17 views
how can I parse the json response from facebook graph api in node.js
I want to parse the json to fetch some data but I cannot parse the json how can I parse the json to fetch the latest picture from the returned json. Below is my code. I am using facebook graph api to ...
0
votes
1answer
7 views
Update a model in Mean Stack / Node / Mongoose
Im having problem to update a model in my API. Im currently using a Mean Stack with "express": "^4.14.0" and "mongoose": "^4.7.2", with mongodb 3.2.11
When i try to PUT the changes to api, i receive ...
-1
votes
0answers
12 views
Error handling in node.js flow using async
I am using async library to handle asynchronous calls in node.js. This is my code now:
async.auto({
one: function(callback){
findBlockedUsersIdsOfGivenUser(userId, callback);
...
0
votes
0answers
11 views
Is there a way to overcome lag between changes in OneNote client and API results?
Changes in OneNote client aren't immediately reflected in apigee. For example:
Renaming a section in OneNote client. Apigee shows the old name.
Adding a section and adding notes to that section in ...
-2
votes
0answers
12 views
Doing a Post Request from Android Asynctask to Node.js
I've been trying to post to node.js with asynctask and send a json with the information to be added to the data bases, but I can't seem to make it work. I am using Heroku Postgresql as my backend.
...
0
votes
1answer
14 views
Mongoose Populate Cast Error
I have the follwing schemas:
// online.js
var mongoose = require('mongoose');
// Online Friends
var onlineSchema = mongoose.Schema({
userid:{ type: Number, ref:'Player' }
},{timestamps : true});
/...
0
votes
1answer
23 views
Parse Yahoo Finance CSV with NodeJS
I am trying to parse a very simple csv file from yahoo finance. The resulting csv just has the current price of the stock. When I am running this I keep on getting this error. Ss there something off ...
1
vote
2answers
20 views
get from collection and iterate over
I want to return data with loop in api.
But you know foreach loop Asynchronous and my allData json object everytime is null.
I want the json object not to be empty.
That's why... I want to make ...
1
vote
0answers
12 views
Typescript: How to resolve absolute modules paths for node.js?
I need modules to be resolved basing on baseUrl so output code is usable for node.js
this is my src/server/index.ts
import express = require('express');
import {port, databaseUri} from 'server/...
0
votes
1answer
16 views
How to send user-specific data between PHP and Node with MemCache or Redis
I now know that MemCache does not work as I originally intended, but I am still not able to transmit user-specific data (such as the id of the member who is logged in) between PHP and Node.
I've only ...
0
votes
2answers
40 views
Generator function with name
I have just started using Bluebird's Promise.coroutine which is a promise version of Generator functions from ES6.
Everything works fine when I create a function and put it in a variable. Like:
let ...
1
vote
1answer
12 views
Sinon stubbing helper method defined in same file
So I have a file, user-database, that looks something like this :
export function foo(id: number): Promise<boolean> {
return new Promise<boolean>((resolve, reject) => {
...
0
votes
0answers
9 views
Handling reconnections in the socket.io server?
When the socket.io client performs an (automatic) reconnection - as might happen if a mobile client went to sleep then woke up again - does the server get a reconnect event? Or does it just see a ...
0
votes
1answer
9 views
nodejs client server issue when reconnecting
I am very new to nodejs and I have some client-server implementation, which basically works the following manner : I submit a form which throws data to a client remote server. The latter send me back ...
0
votes
1answer
14 views
Node stream : pull n lines, tranform and continue
In my NodeJS, I would like to read a big file, process it by fragment (by n lines), consume the data and then process the next n lines.
I've try to use several modules (fs, es-stream, node-etl for ...
0
votes
1answer
22 views
Multer access req.body without uploading files
I have a form with some text fields and file inputs which cannot be empty, I want to do some operations with the text fields first(adding to database) and if these operations were successful then ...
0
votes
0answers
13 views
How to bulk insert in mySql and node.js using mysljs
Im not able to use bulk insert in my DB using node.js lib mysljs.
I followed answers from:
How do I do a bulk insert in mySQL using node.js
with no success.
var sql = "INSERT INTO resources (...
-3
votes
0answers
16 views
Recording internet radio streams using nodejs?
I would like to write a little tool which records internet radio streams at certain times. So I would be able to say "Tomorrow, record radio station X between 3pm-4pm". I cannot find any useful ...
0
votes
0answers
8 views
MongoError: topology was destroyed(when finding the documents) and instance pool was destroyed (when inserting documents)
I'm trying to build REST API with Node.js, Express and Mongodb. I'm using mongodb npm package to connect to the database, below is my sever.js file code
var express = require("express");
var app = ...