Most voted "node.js" questions
Node.js (or commonly Node) is a Javascript Runtime created with Chrome’s Javascript V8 engine. It allows you to run Javascript code without the need for a browser, raising the privileges to those found in other desktop languages. It is a technology strongly focused on non-blocking programming of I/O operations, which makes it very efficient for these operations.
Learn more…2,679 questions
Sort by count of
-
3
votes1
answer66
viewsRollback does not work
So guys I have a transaction to persist various data on different tables in my database, if by some chance a record goes wrong I need it from a rollback, after all I depend on the return id of one…
-
3
votes1
answer117
viewsHow to access static methods of a class included in the consign in Nodejs?
Hello. I am building an application with nodejs and I need to authenticate users by registering a new user and logging into the application. I’m using consign to perform autoload of my scripts, as…
-
3
votes2
answers60
viewsExpress - Suggested experience, how to handle this type of code repetition
I’m studying the library (Express) and the language (Javascript), but this type of repetition below ends up bothering me and. I wonder what you would do in the situation to reduce the repetition of…
-
3
votes1
answer57
viewsFiles for nodejs settings
I’m trying to make a file with the settings but not quite sure yet how to accomplish this, in this way searching various contents, I found some features where facilitates me but it would not be my…
-
3
votes1
answer169
viewsWhat is the difference between "test" and "spec" in automated testing?
The question and doubts below address Node.js, Typescript and Javascript. I don’t know if the concepts below apply to other programming platforms/ languages. I am studying about automated tests (AT)…
javascript node.js typescript software-engineering testingasked 3 years, 4 months ago Cmte Cardeal 5,299 -
3
votes2
answers450
viewsWhat is Aggregate in Mongodb?
I know this kind of doubt I find "easily" in the documentation itself and on the internet, however even in the official documentation became very confused and very technical with several unknown…
-
3
votes1
answer60
viewsHow can a value be invoked (as a function) at the same time as it contains properties (as an object) in Javascript?
I was left with a question concerning the structure of the Express. How Express can be invoked, as in express(), but can also have in its structure access to the Router property, for example? I…
javascript node.js function characteristic-language objectsasked 3 years, 3 months ago Otavio Fagundes 978 -
3
votes2
answers87
viewsRegex to catch single word
I’m trying to create a regex that takes an exact value within a text, example: let texto = "troquei meu carro por um outro carro uma carroça" console.log(texto.replace(/carro/g, 'barco')) The…
-
3
votes0
answers48
viewsProblems with formData in Multiple Upload Express and Multer
I’m having trouble uploading multiple images to the backend. The method in the backend is correct, when I test via insominia the right one, however from my front it does not generate the data…
-
3
votes1
answer95
viewsHow to import content from a JSON within an ESM (Ecmascript modules) module in Node.js?
It is common for me to see online courses, articles and tutorials over the internet, Node.js codes that can import local JSON files into code to be manipulated, used, tested, etc... In these…
-
3
votes2
answers86
viewsWhy does Node.js accept value assignment with the "Undefined" identifier?
I was conducting a quiz on Node.js until I came across the following question: Which message will appear in the terminal for the following code executed by Node.js: Code (note that it runs outside…
javascript node.js characteristic-language objects undefinedasked 3 years, 1 month ago Cmte Cardeal 5,299 -
2
votes1
answer240
viewsEvents.js: 72 error - Error running my first global app with express
I did the global installation of express on Ubuntu (and on my Mac too) using npm install -g express Then I created my app using the command: express -se hello_express I entered the application…
node.jsasked 10 years, 4 months ago Leandro Cissoto 67 -
2
votes1
answer866
viewsHow to make synchronous queries with Sequelize on Node.js
I started to stew Node.js not long ago and I am using the division of logic into modules. I have a UserSessionController validates whether the user session is still valid:…
-
2
votes1
answer438
viewsNode install without npm only via . zip
I need to install a nodejs module on a server and it has no internet access. if I lower it on github, how to install it on the server? I don’t want to use npm install to download directly from the…
node.jsasked 9 years, 11 months ago BRUNO RUIZ 21 -
2
votes1
answer964
viewsView engine alternatives for nodejs?
Alternatives that are not Jade and similar, I try to know alternatives that can write the complete syntax (HTML and CSS)?
-
2
votes1
answer166
viewsNodejs + sqlite3: error retrieving information from Select
I’m learning nodes. I am trying to integrate it to Sqlite3, but when trying to read a database information is being generated the following error:…
-
2
votes1
answer1082
viewsProblem with passing Nodejs/Express parameter
I am creating my first application in Nodejs and managed to structure the application, connection, directory structure, routes, in short, everything working right. Now, I went to implement the login…
-
2
votes2
answers3564
viewsHow to send/receive data from client to server?
How to send/receive client data to the server, making requests as a search in the database dynamically?
-
2
votes1
answer338
viewsHow do N identify the path from the root of the request?
It’s like this: <link rel="stylesheet" href="http://localhost/node/softmon/css/style.css" type="css"> If I put it like that: <link rel="stylesheet" href="/css/style.css" type="css">…
-
2
votes1
answer1425
viewsHow do I use Node.js to run a PHP page?
My case is the following: the microcontroller sends data using GET to the server, it saves it in the Mysql database and tests if it needs to trigger the alert. This alert is made with a PHP page…
-
2
votes1
answer174
viewsHow to find exact Regexp and do this using constructor syntax?
I have an algorithm that takes several complete file paths and checks if each of them is 'forbidden' by the server. The var s of for is related to each of these paths and the sets is an array with…
-
2
votes1
answer561
viewsDigital Signage System with Nodejs, is it possible?
I have a question about Node JS and what I could do with it. I started studying about MEAN a few days ago and I was wondering if using this technology I could, for example, create a system of…
-
2
votes1
answer1704
viewsEdit an element within an object, within an array, with Mongoose
I could use a hand! I am new to Node.JS and decided to "create a system" to put into practice what I already know and create challenges to encourage my learning! I did a beginner workshop (with Jean…
-
2
votes1
answer44
viewsGenerate Json x Search in mongodb
I’m generating a Json. But I have the following situation: I have a record of contacts who may belong to the same company. I mean, I can have two people registered in a single company. How do I load…
-
2
votes2
answers2443
viewsreq.Session in Node.js
I would like to know how the basic req.Session structure of Node.js. Is it native to Express or express-Session? Please help me understand more about sessions.
-
2
votes2
answers158
viewsError - Password update bcrypt
I am unable to encrypt my password during an update using bcrypt in Mongoose. The password is changed smoothly but without encryption. Follow the schema: var mongoose= require('mongoose');…
-
2
votes2
answers1001
views -
2
votes2
answers564
viewsEdit data from Nodejs
I have a Crud Nodejs where I can add data in the database, but now I wanted to edit this data and the tutorial I follow is a little old, in this tutorial the editing is done by PUT my JADE page is…
-
2
votes1
answer979
viewsPackage installed with npm is not available at command prompt
I installed the nodejs v0.12.6 on my computer with windows but I had some problems. The first one I found a solution in the internet very simple e I thought that everything would work normally…
node.jsasked 8 years, 11 months ago user23124 -
2
votes1
answer454
viewsErrors installing Phonegap/Cordova - Nodejs
Your environment has been set up for using Node.js 0.12.6 (x64) and npm. C:\Users\Alexandre>npm install -g phonegap npm **WARN** addRemoteGit Error: not found: git npm **WARN** addRemoteGit at F…
-
2
votes3
answers2215
viewsNodejs NPM does not work
Guys, I installed Node normally and added it to the environment variable; I did some math operations to test and it worked. When I tried to install modules (socket.io and express) it did not work,…
-
2
votes1
answer55
viewsWith generating client_secret for an Oauth2 API
I’m using Nodejs, but I believe the question may be useful in other languages as well. The oAuth 2 specification does not determine the size of the string that should be generated, it only informs…
-
2
votes1
answer81
viewsSocket.io: module cannot be found
I was here "playing" with Socket.io, all working nicely, when I gave the command node app.js overnight Nodejs gives me an error (it was working before) Cannot find module 'socket.io' I looked for…
-
2
votes1
answer329
viewsFind in Bank Mongoose by Nodejs
I’m trying to access the Mongoose bank, doing a find on the nodejs. In Mongoose, I have the following data: Client:{ name: {type: String, trim: true, required: false, default: ""}, address:{…
-
2
votes0
answers197
viewsSend photo Api Rest nodejs
I am developing a restful api with nodejs and mongodb. And I am creating an endpoint for user registration, but I would like to send a photo at the time of registration. Which of the three solutions…
-
2
votes1
answer175
viewsIs it possible to use Cordova with nodemon?
I’m starting to study more Cordova but every time I need to use the cordova run browser to go up the server and test the app, with Node I use the nodemon to keep the server updating without having…
-
2
votes0
answers78
viewsScript (automate a site’s fields)
Hello, they passed me a task that I do not know how to start, automate some fields of a given site, not to need to keep typing them every month, I was given a spreadsheet with several values, and I…
-
2
votes1
answer1168
viewsProblems with localhost application with Angularjs and Nodejs
I’m having some questions and problems trying to create a server with nodejs. The point is I have an application developed with Angularjs very simple and want to do another in nodejs which basically…
-
2
votes1
answer1050
viewsNode.js - Function returning the query value?
It is the following I tried to search but I did not find any solution, to try to create a function in the model of my application that will return the data of the query in the database. This…
-
2
votes2
answers389
viewsAsynchronous server execution problem with Express, Mysql and Socket.IO
I am developing a Node.JS project with Express, Mysql and Socket.IO. When the user opens the main page provided by the server, the request must cause data to be read from the database and sent to…
-
2
votes1
answer2597
viewsHelp with installing Ionic Framework for Mobile Development
To install the nodejs more clearly, I followed the example given through the site below, in the error note below, says that the version I am using is: 0.13.0-pre…
-
2
votes1
answer53
viewsGruntjs error in installing plugin using Vagrant
I try to install the puglin npm install Grunt-contrib-uglify --save-dev in my project using Vagrant and gives error permission follows below : npm ERR! Please try running this command again as…
-
2
votes1
answer777
viewsRead file and assign each row in a different variable
I have the following file: mensagem 1 mensagem 2 mensagem 3 mensagem 4 I would like to read this file using the Javascript language, and to each line, assign to a different variable.…
-
2
votes1
answer336
viewsHow to receive a facebook username? Graph API
Hi, guys. How to get a facebook user id, and its name using Graph api? I can only get the message id using sender = event.sender.id; function fbGetProfile(id) { request({ method: 'GET', uri:…
-
2
votes2
answers736
viewsTraverse an array without knowing its indices
I own the following array: var array = { x: "Primeiro Valor", y: "Segundo Valor", z: "Terceiro Valor" }; I would like to access the values, however, I do not know the indices x,y,z, it is possible…
-
2
votes1
answer505
viewsSet date 7 days/a week ago
I would like to get today’s date, and subtract it from 7 days. Remember that if we are on the 2nd for example, you should subtract 1 from the month. The same applies to the year. Unfortunately, I…
-
2
votes3
answers2889
viewsGet Defined/Current Time Difference
I would like to get how many hours has passed, from a given date, to the current date. For example: day = "Thu May 19 2016 05:00:00 GMT-0300 (BRT)"; today = "tue May 23 2016 09:00:00 GMT-0300…
-
2
votes0
answers272
viewsServer nodejs stops accepting connections after a running time
I made an application to control simultaneous logins, in starts everything works perfectly, but after a few hours I can’t connect to the server the client returns me the following error…
-
2
votes1
answer62
viewsHow to control the contrast of videos using Electron?
On the left side is my Electron app with a youtube video. On the right side is my app created with pygtk2 and Webkit. The contrast is better with the Webkit. With the Electron, the blackboard around…
-
2
votes1
answer79
viewsGet Timezone from a date
I have that date: 2016-02-22T14:55:00.000-03:00 And I’d like to take the Timezone: -03:00 Automatically, without having to perform any regex.…