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-...

learn more… | top users | synonyms (2)

-1
votes
0answers
9 views

Trouble understanding XHR streams and express

I'm having some trouble understanding how I can trigger an XHR response from an express server res.write. I'm creating a request on the client with the following code: var xhr = new XMLHttpRequest(...
1
vote
0answers
14 views

Node.js/Firebase - listener never triggers

I'm running Node.js and Firebase on several Raspberry Pi systems to prototype some cloud functionality for a client. I'm running Node.js on the Raspberry Pis and on my PC, a Mac. I created an ...
0
votes
0answers
10 views

node-mssql multiple prepared statements with single connection

I'm banging my head against this library. I tried to setup a singleton intermediary class that would start the start the connection and then share that connection via static methods. My problem is ...
1
vote
2answers
12 views

How to manipulate attributes of an object passed to a function without mutating the state

I would like to know if is possible to change attributes of an object passed to a function without mutating the state of the object. Something like this: function startOfLine(options) { options....
0
votes
1answer
7 views

How to generate images server-side in Meteor and serve them via Iron Router?

Like the title says, I just want to generate an image on the server and then serve it up in the browser via Iron Router. Here's what I have so far: server/methods.js: Meteor.methods({ getImage(...
0
votes
0answers
20 views

Node js - How to return a boolean [duplicate]

i'm trying to return a boolean 0 or 1 but doesn't work. How can i do that? checkKitReference(req, res) { var ref = req.params.ref; console.log("SELECT ref FROM st WHERE ref="+ref); ...
-1
votes
1answer
11 views

Why does node hear two requests? (Favicon)

I've tried to make a simple API. If someone/something queries: myIP:port/query It should serve some result. However, I've noticed that (at least) when the query is made by a browser (Chrome), the ...
2
votes
2answers
27 views

Destructure nested object with defaults, including nodes

With ECMAScript 6, I can write this: const { a = mandatory('a'), b: { c = mandatory('c'), d = mandatory('d') } = mandatory('b') } = { a: 'a', b: { c: 'c', d: 'd' } } console.log(a, b, c,...
0
votes
0answers
11 views

omit fields from api response using hapi

I'm using Hapi.js for my API and trying to determine the best way to limit the fields returned in a response based on a user's role. For context, I'm running Hapi.js and using Bookshelf.js to handle ...
1
vote
1answer
12 views

Including External 3rd party scripts in Apostrophe CMS project

How do you push a 3rd party script from a custom module in Apostrophe CMS? I am following this helpful tutorial to build a form for my Apostrophe CMS site. I am needing to put a reCaptcha thing on ...
-1
votes
1answer
24 views

IndexOf not working properly

I am completing a fairly complicated process in node and for it to work properly I need to compare the value of a key in an object to an array. I have checked to make sure I have no async issues and ...
0
votes
0answers
7 views

`make` failed with exit code: 2 at ChildProcess.onExit (/usr/share/node-gyp/lib/build.js)

I have certain application which exposes about 100 Soap Web Service Services and I need to "facade" them as Rest Service using NodeJs. In other words, I will create a rest service that will recieve ...
0
votes
0answers
7 views

Is it possible to pass a variable declared in a PUG/JADE file to the server side?

The title says it all. I want to be able to declare a counter variable in the client side and pass that value back to the server side. Thanks!
0
votes
1answer
11 views

Socket.io object with no data sent in the first go[setInterval]

Ok, so I have a NodeJS app that I am creating. It involves sending a HTTP request to an API, which returns JSON data, which I want to display to the client in real time using socket.io I'm using ...
0
votes
1answer
10 views

expressjs sessions not working across subdomains

I'm using sessions in express and have it setup as: app.use(session({ store: new RedisStore(), secret : '', cookie: { path: '/', domain: '.localdomain.com' }, resave: false, ...
0
votes
0answers
9 views

MQTT client not working

I'm trying to publish messages using a button click event. The client is suppose to send ON and OFF payload. For some reason that I cannot fathom why this is not working. server.js var io = require(...
0
votes
0answers
6 views

node.js SMPP GSM 03.38 Extended characters

I am using Node SMPP and trying to send a message with GSM 03.38 extended chars but it doesn't work. If I send "€" then "e" is received If I send "{" then "(" is received I've checked a library code ...
0
votes
0answers
14 views

Replace objects evaluated property inside EJS forEach with client side variable

Hope my question is not too confusing. Essentially, I am trying to update a EJS forEach statement to change the object property that is being looped over to a different property. I am getting the ...
1
vote
1answer
12 views

res.json returning unintentionally modified input

My res.json function seems to be modifying my data. If I log the data in the function it returns the proper data. Only inside res.json does my data change and I can't figure out why. For ex. Instead ...
1
vote
1answer
19 views

How to flatten sub-documents in mongo db

My collection has document like this { "_id" : ObjectId("587c8d0364b6e32706f7edef"), "first_name" : "John", "last_name" : "Doe", "password" : "aasdjsabb12213b21bbcghc1h2", "shift" : "A", "dept" : "...
1
vote
0answers
16 views

How do I follow an oath 1.0 redirect with Node?

I'm using this API: https://github.com/JohnDeere/MyJohnDeereAPI-OAuth-NodeJS-Client and I can't follow the redirect on the back-end. When I visit localhost:3000/oauth from the browser, the /callback ...
-3
votes
0answers
14 views

Waiting for a new element in a MySQL table

I'd like to be able to detect when a new element is added in a MySQL table on my server, but I don't know where to start... I think that refresh a PHP page every 10 seconds is not a real solution! ...
0
votes
1answer
13 views

Node.js SteamBot not working

my Node.js Steam-Bot isnt working. When i try starting him it always gives a Syntax Error: /root/bot/node_modules/steam-tradeoffer-manager/lib/index.js:3 const SteamCommunity = require('...
1
vote
0answers
17 views

Most efficient way to keep the user logged in

I'm building a school project in Node.JS, thats the first time that I am developing an app in Node.js. And I would like to know an efficient way to keep the users logged in on my app. I'm storing ...
0
votes
1answer
22 views

Node: check `bolean` value from defined `model`

I am trying to update position in my todo list var Todo = mongoose.model('Todo', { text : String, done : Boolean }); database mode has two elements, and I want to update only boolean - done....
0
votes
0answers
50 views

Html page to send request to node.js app [on hold]

I have a problem in HTML. I have a node.js service to resize and image in: http://192.168.58.131/fetch And I need to have an HTML page that I can write width, height and an image link. My idea is ...
-1
votes
1answer
15 views

cheerio.Js does't return any value . Below my Code

Below my Scraping Code using NodeJs and Cheerio . I want to get the html code inside the each loop but it doesn't return anything var request = require('request'), cheerio = require('...
-2
votes
0answers
16 views

How to create a similar service as Bubble.is? [on hold]

Can I create a similar service as bubble.is build from existing services/solutions (php, node.js...) offered on the market?
0
votes
1answer
18 views

Nodejs crashes when reading from disk

I'm working on a website based on expressjs which streams videos and users can download video files from it. when I start the app, everything works well. But after some while app can not stream videos ...
1
vote
1answer
16 views

Node and Express Routing - 404 error

I'm getting back 404 error using nodemon and not quite sure where the problem is. Any tips / resources appreciated! project root $ curl http://127.0.0.1:3000/v1/protected Cannot GET /v1/protected ...
0
votes
2answers
22 views

How to save my data when i refresh page?

i want to save my progress bar with text around him, when i refresh page ? I try to save session storage but without result ... Html > <!DOCTYPE html> <html> <head> <...
0
votes
2answers
19 views

Find a mongo subcollection by id

I need help with this query. how i can find a subcollection? Collection clientes db.clientes.find({ _id: ObjectId("587cc2d8704ae610d3741e6b") }); { "_id": ObjectId("587cc2d8704ae610d3741e6b")...
0
votes
1answer
16 views

How can I change the default location of Node Command prompt?

How can I change the default location of Node cmd to any desktop folders? Currently, it's showing: "C:\Users\Sowmay>" I'm a complete beginner.
1
vote
0answers
10 views

Express-Session and Mongostore multiple deployment overlapping cookie error

I am running two app instances on DigitalOcean. One is on example.com and the other is at beta.example.com I'm using mongostore with express-session and each site has a separate mongo database. I ...
0
votes
0answers
12 views

Unable to find a usable idle daemon while trying to install a cordova plugin

I am trying to install the vibrate plugin in my Phonegap app with the CMD. When I enter the command to install the plugin (phonegap plugin add cordova-plugin-vibration), it works for a bit then it ...
0
votes
0answers
6 views

Node How to render a template and then the homepage?

At first I want to render the template navbar and then I want to render the homepage. But I get an error which says left_1 and left_2 are not defined. Homepage includes navbar. If I only render ...
1
vote
1answer
14 views

Assign specific number to letter

I'm working on a little text-based Blackjack game in NodeJS. I've got this array: const ranks = Array('A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K'); The game picks a random ...
0
votes
1answer
15 views

NodeJS: How to get objects with variable child properties with MongoDB?

I am trying to get an array of documents where a child property is true. Here's some code: public static getTeams(req, res) { // Initialize a connection to the database Globals.initDb(res)....
1
vote
0answers
19 views

Is there a way to get query parameters from the server's routing table after the server has started?

I have a route called /routes. It returns... you guessed it! ... a list of routes. route = { method: 'GET', path: '/routes', config: { description: "Return a list of routes" }, ...
0
votes
1answer
8 views

Removing a child element in subdocument not working

I'm fairly new to Mongoose and don't think my approach on deleting an item in a subdocument is the right one. I have the following schema setup: //DEPENDENCIES var mongoose = require('mongoose'); ...
0
votes
0answers
13 views

JavaScript + MongoDB - Having some hard time accessing DB information (Newbie in JS)

I am new to javascript and despite having experience with Python/PowerShell/Bash, this seems quite different (I am sysadmin so not much into programming, but scripting). I have the following code : ...
-2
votes
1answer
11 views

How to get mysqlx npm package?

I want to use MySQL document store. For this, I have gone through MySQL documentation. As per documentation, I need to use 'mysqlx' npm package. But when I searched for 'mysqlx' package on npm website....
-1
votes
0answers
8 views

How can i minus value from 2 columns and then apply max function in sequelizejs?

I am trying to get a max record after minus 2 columns value. I am able to make that query on phpMyAdmin SELECT * FROM `storages` WHERE size - used = (SELECT MAX(size - used) FROM `storages` , but ...
1
vote
0answers
22 views

NodeJS: 'toString()' failed when require a large JSON file

I am trying to load a very large JSON file (360 Mb) on Node + Express but the line below returns this error. How should I process it then? var emails = require("../fake_IO/cleaned_data_lang.json"); ...
2
votes
1answer
22 views

Windows Electron Application Packaged with Electron Packager not displaying properly in task bar

I'm using Electron 1.4.13, and electron-packager 8.5.0. This is happening on Windows 7, 8, and 10. I am not using electron-builder because Squirrel did not meet all the requirements I needed for an ...
0
votes
0answers
6 views

synchronous loop for insertion of datavalue in SQLite

I am using sequelezer to insert the values into local database. It kind of setup script that need to run on the first time on server. Due to nodejs "asynchronous" function call, my sqlite db is ...
0
votes
0answers
9 views

How to perform full text search on PostgreSQL via Loopback?

I am using Loopback for my application — I need to perform a full text search on tables in the database. I've read the PostgreSQL documentation on text search but I'm not sure how to make these ...
-1
votes
0answers
13 views

Express combined with browser-sync with node

I am very new to the world of JavaScript and i am trying to build my development environment for the first time what i want to achieve should be simple... I want to run an Express server along with ...
1
vote
1answer
13 views

API Route tripping error handling when it shouldn't

I have an Node/Express API route. It's supposed to return a JSON response with the time stamp and the date after I use the URL to put a timestamp in. For example, http://localhost:3000/1448928000 ...
1
vote
1answer
10 views

What does module.exports do when used in a variable declaration

I was looking at some other people's code, and I saw this line. var app = module.exports = express(); Does that mean that app is set to a express, and is simultaneously exported? How does Javascript ...