Questions tagged as 'node.js'

2
answers

Store result of promise in a variable

How can I store the promise result in a variable? A promise returns the result of a query of the database. function consultaMarcas(){ return new Promise(function(resolve, reject) { connection.query('SELECT * FROM marca',(err, result)...
asked by 23.07.2018 / 16:35
1
answer

What password encryption should I use with Node.js? Which is safer? [closed]

I am doing a course of node.js and in this the tutor uses md5 to encrypt the password .. more read on some articles that md5 ñ is very safe .. what is the most recommended to use with Node.js? Thank you!     
asked by 02.05.2018 / 00:38
1
answer

Is it possible to add data from a node script to html?

I'm fairly new to node.js, but I wanted in humility to understand why a code only appears in the node's console.log and can not store some variable so I This is the API I am using: link var http = require('http'); const...
asked by 05.04.2018 / 02:08
2
answers

Node.js - How to read user input from the console?

In Java: System.out.println("Diga algo: "); Scanner leitor = new Scanner(System.in); String resp = leitor.nextLine(); //ou nextInt, nextDouble, etc In C ++ cout << "Diga algo: "; string name; cin >> name; How to read input...
asked by 26.03.2018 / 06:19
1
answer

NPM - modules and proxy

Good afternoon I'm trying to install the ibm watson module in my app, but I get error below I'm on the corporate network ... What I wanted to know is if I can "dribble" or configure this proxy in some way    C: \ Users \ birth \ Desktop...
asked by 25.06.2018 / 20:37
2
answers

Uploading multiple images with Multer

I have a problem uploading multiple images with Multer. I saw that it has attributes like ANY, SINGLE and ARRAY. I can use SINGLE to send a single image, however I need to use multiple images, and I'm not able to implement. My code is as follows...
asked by 27.01.2018 / 07:12
1
answer

Escape symbols in NodeJS

I have the following code running on NodeJS /*jshint esversion: 6 */ const express = require('express'); const bodyParser = require('body-parser'); const app = express(); const port = 8080; app.use(bodyParser.urlencoded({extended: fal...
asked by 02.03.2018 / 16:18
1
answer

Modularize NodeJs Connection with PostgreSQL

I'm having trouble creating a module in nodejs to export my connection to PostgreSQL . I could not understand why the second code does not work because I would like to export connect already. Code 1 . var pg = requ...
asked by 31.10.2017 / 02:57
1
answer

Passing values between Express and EJS

I have a foo value that is obtained in an asynchronous method in a db.js file. The query is being performed normally and I can already capture the data of the foo variable in my index.js file, but when trying to pe...
asked by 04.09.2017 / 23:01
2
answers

E-mail user registration authentication in Node.js [closed]

I'm developing a user registration screen, and the need arose to authenticate the user's registration by email, the procedure would be something like, when confirming the registration an email is triggered for the user, and the same to complete...
asked by 31.07.2017 / 22:48