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
-
7
votes4
answers1794
viewsNode replaces Nginx? Can someone explain this architecture to me?
I was reading a article about the "dawn" of Javascript companies. The "dawn" in the sense that things are just beginning. That is, according to the author, the future is Javascript, with Nodejs, and…
-
7
votes2
answers97
viewsHow to see the implementation of the Typescript code?
In several programming languages that I have worked or currently work with, I can see the implementation of the developed codes. In Dart or Java for example, I can go to the source code and analyze…
-
7
votes1
answer2366
viewsHow to assign the result of a Promise to a variable?
Even reading this one another question of the site, I still do not understand why I can not withdraw a value from within a Promise. How do I do that kind of assignment? The idea is to execute…
-
7
votes2
answers421
viewsHow to apply conditions in this string template?
Currently I own this object: const messages = { required: field => `${field} é obrigatório e naõ foi preenchido!`, } That prints the following value: name é obrigatório e não foi preenchido! I…
-
6
votes5
answers6659
viewsBrowserify + Nodejs [Node: File or directory not found]
Situation I’m developing an extension for Google Chrome, and I need to use some Nodejs modules so I found the Browserify tool so I can add modules to use it in the browser Ambience I own Nodejs, NPM…
-
6
votes1
answer482
viewsWhat are the suffixes of NPM versions and what do they do?
In Node.js environment when we fetch modules from NPM suffixes can be used to specify versions. For example, in the package.json I often see: "dependencies": { "async": "~1.4.2", "express":…
-
6
votes1
answer1320
viewsReceive parameter in delete request
I am trying to pass a parameter to my DELETE request, I tried to do the following: Use in the same way I use in GET (where it works normal). app.delete('/contatos', function(req, res){ var obj =…
-
6
votes2
answers2441
viewsConvert date and time to numeric value in Javascript
I saw in the Kibana dates are treated as numerical values. For example, the date 2016-05-03T10:00:00 is equal to the numerical value 1462280400000. I would like to understand how this works, and…
-
6
votes1
answer890
viewsHow to maintain multiple connections with postgresql in Node.js?
I am used Node.js in a task where I need to migrate data between two Postgresql databases. The idea is more or less the following: Connect to Bank A. Connect to Bank B. Return all records from A.…
-
6
votes1
answer380
viewsWhy use two server-side languages on the same system?
Why I see many systems with two, up to three programming languages? When I see a system that migrates from one language to another, I even understand, but why do many maintain two or three…
-
6
votes1
answer64
viewsAssemble structure with hexadecimal data
Personal talk all right ? I get from a socket a buffer of 116 bytes in hexadecimal these bytes have a structure, for example: From the beginning: 2 bytes = 1ª variável 1 byte = 2ª variável 1 byte =…
-
6
votes1
answer325
viewsThe Node in the World . NET would be CLR or . NET?
Since Node is a development platform server-side in JS... and . NET we have CLR (Common Language Runtime) the Node would be the CLR that compiles? Or a framework like . NET, as two import modules I…
-
6
votes1
answer1162
viewsDeploy App Node.js on localhost(Production)
I developed an application with Angular + Node.js. The only detail is that there is no centralized server (Node.js), that is, each client will have its version of the server running on its network.…
-
6
votes1
answer96
viewsDate conversion
I have a date in this format "2017-10-13T18:15:41.143Z" And I would like a date in this format 10/06/2017 01:42:34 PM (-0300) How can I make the conversion?…
-
6
votes1
answer940
viewsHow to split code into multiple modules?
I know that it is possible to separate functions into other files on Node, called modules, as follows: js server. var http = require("http"); var servidor = http.createServer(); var porta = 3000;…
-
6
votes1
answer735
viewsHow to turn an asynchronous function into synchronous?
I have an asynchronous function and I would like it to become synchronous, because being asynchronous she is sending the data to the client before even completing the necessary steps, follows code:…
-
6
votes4
answers729
viewsHow to get the month formatted with zero left in Typescript
I’m trying to get the month in Typescript with Node.js, I’m trying to get it like this: const today = new Date(); var todayMonth = today.getMonth() + 1 if(todayMonth < 10) { todayMonth = '0' +…
-
6
votes2
answers218
viewsAlternative to __filename and __dirname in Node.js with Ecmascript Modules
From more recent versions of Node.js, you can use the Ecmascript Modules standard (instead of the ancient Commonjs) for importing modules via extension .mjs or field type defined as module in the…
-
6
votes1
answer90
viewsHow do I know my function is breaking SOLID POO?
I left a function below that will be the subject of the question, basically I would like to know if this function breaks any principle of SOLID/Clean Code by itself ? This doubt arose because…
-
6
votes2
answers191
viewsTypescript - Incorrect code output - Date
Why the output from that code is: Pessoa { Id: 1, Name: 'Maicon Gabriel Friedel', DateOfBirth: 1997-02-22T03:00:00.000Z } Code: import pessoa from './pessoa' pessoa.Id = 1; pessoa.Name = 'Maicon…
-
6
votes1
answer102
viewsHow does . pipe() work on Node.js?
I have a question about how the .pipe(). I saw videos and read the documentation, but I’m not sure how it works. From what I understand, he basically takes the information from a readableStream and…
-
6
votes1
answer115
viewsWhy should we interrupt the Promises current in recursive functions in Javascript?
I will exemplify with codes. I have an asynchronous function called delay which receives a time in seconds and which returns a Promise. It serves to provide a waiting time in seconds: // padrão de 1…
-
5
votes3
answers1894
viewsIs it possible to import Javascript variables (Node.js)?
I have variables in app.js: var G = {}; module.exports = G; var DATA = G.DATA = 'DATA'; var F1 = G.F1 = function(val) { return val; }; This way I can export variables under the object G, and at the…
-
5
votes2
answers1118
viewsOptions to generate javascript library documentation
Currently I have used much the jsdoc3 with the docstrap, however requires a large amount of third party libraries to generate documentation with node and grunt, someone knows a robust alternative…
-
5
votes2
answers999
viewsHow to wait for the result of a Restful API in Nodejs
I work with an Amazon JSON API, in which I research products and handle information according to their results, but within Nodejs the API information is written on the console, but it is not written…
-
5
votes2
answers772
viewsHow to search for a device on an internal network using Javascript and/or Node js
I’m creating an application that uses Websocket to connect two devices to an internal network, but for that to be done, it is necessary for the user to enter the address of the Node js server in a…
-
5
votes1
answer1009
viewsPromises as function return in Node.js
I am using the Sequelize.js. framework to perform queries in the database, the result of the function find returns an object with 3 methods: success, error and complete Ex.:…
-
5
votes2
answers2465
viewsWrong time on Mongodb
When I put in the schema mongodb: created: { type: Date, default: Date.now } The time is with a difference of 3 hours more. How can I fix this?
-
5
votes1
answer818
viewsWhatsapp Web uses Node.js?
I would like to know what technologies used in the development of Whatsapp Web. Ps: Question at search level.
-
5
votes1
answer1433
viewsCheck server uptime with Node.js
I am making several HTTP requests at a certain time and wish to check only the return status. There are paths that require login to the application but as it is a very basic script and is not…
-
5
votes1
answer224
viewsHow to merge into a file already minified with Grunt-contrib-uglify
Here’s the situation, I’m using the Grunt-contrib-uglify to minify my project’s javascript into a single file, the problem is that one of these files is already minified, and the uglify does not add…
-
5
votes3
answers4489
viewsLike "startar" a Node server?
I installed Node, created the environment variable (NODE_ENV) speed value. When I installed and configured, I printed out a arquivo.js with hellow world and it worked. Today, I want to start the…
-
5
votes1
answer1429
viewsHow to use the Node Passport.js to login against the database
How to use Passport.js to control access using the express.js database and middleware. How to do login logic and how to know that the session is already authorized when the user has already logged…
-
5
votes1
answer842
viewsIs it possible to do form authentication/validation with pure Node.js?
Today I became interested in Node.js for being able to program javascript in the back-end and front-end. From what I understand - correct me if I’m wrong - Node is a platform that allows me to…
-
5
votes1
answer711
viewsMulter file upload callback - Nodejs
Hello anyone ever used multer(express/nodejs module) to upload files? If so, how did you manage to capture the events of callbacks (onFileUploadStart and onFileUploadComplete)? Theoretically I am…
-
5
votes1
answer1284
viewsphp vs nodejs performance on websockets server
What I take for granted at the moment is that nodejs is more suitable to work with a constant pool of socket connections (websockets in this case) because being single-threaded each new connection…
-
5
votes1
answer453
viewsUse Node.js or PHP with Websockets?
Using Websockets for my project, at the end was an extensive project with thousands of lines of PHP code. As soon as I finished writing everything and "finish" I am told that running Websockets with…
-
5
votes2
answers419
viewsIs it possible to restrict access to variable information with Angularjs?
Hello, I am new to development and would like to know if there is any way to hide information from variables in Angularjs , I am using a Mongolab API and did not want to make my apiKey visible to…
-
5
votes2
answers220
viewsHow does Nodejs manage package.json in sub-folders?
How Nodejs manages Packages.json in sub-folders? You have your normal application but you have sub-modules that you want to have your own dependencies, how does Node manage it? It creates another…
-
5
votes1
answer433
viewsHow to detect Mysql changes in Nodejs?
Good night, someone has already used this package or knows a similar one that works? Link: https://www.npmjs.com/package/mysql-events Goal: launch an event when there is a change in the database.…
-
5
votes2
answers3089
viewsJS node - Mongodb x Mysql
Why every JS Node tutorial we see, is always shown example in Mongodb. What you both have that are so used? Why not use Mysql with Node?
-
5
votes1
answer1031
viewsNodejs deploy in production
What are the best practices for doing the deploy in producing of a Node.JS application? I would like to know how the deploy in production of API’s Node.JS. My application is today dockerized and…
-
5
votes1
answer684
viewsNodejs running at Gate 80 with Apache
Well, it’s like this, whenever I want to use socket.io I have to use some port, so whenever I want to have access to the web page that works with the socket.io I have to go to : wwwwww.meusite.com:.…
-
5
votes2
answers3112
viewsIs there a URL in Nodejs?
Good is the following I needed some function that served me as "Curl", to use in nodejs. Is there any Function, which does the Curl equivalent in php? Thank you.
-
5
votes1
answer566
viewsBecause my program does not generate CSV in UTF-8 that can be read correctly by Excel, but Notepad generates
I have generated files .CSV in javascript, in UTF-8, but not read with the correct encoding in Microsoft Excel (generating invalid characters instead of accents, as if you were reading ISO 8859-1 or…
-
5
votes1
answer152
viewsSharing JSON object between different clusters
Good afternoon, I would like to know how to share a JSON object between different clusters. I currently have 3 clusters listening to three different doors. And I need to have an object saved in…
-
5
votes1
answer411
viewsBabel for those who have never used Nodejs
Maybe because I have a much greater experience with PHP I’ve never been a fan of Javascript. I always found the syntax of language confusing and complicated and often resorted to jQuery to do simple…
-
5
votes1
answer563
viewsJavascript Image Handler
Is there any image handler similar to canvas or jimp for node.js? Explanation of why you don’t want to use either: So I was trying to use canvas as a test, and it’s taking too long to compile the…
-
5
votes2
answers290
viewsHow to debug Nodejs code?
In my initial studies in web development with NODEJS I have the following question: a tool to debug NODEJS codes in a Web system ?
-
5
votes2
answers636
viewsRequest of type Options
My question is, whenever I make a request before it is actually sent a Options request, I wonder what it’s for exactly. What impact can I have by removing this request both on performance(internet)…